page_type | languages | products | description | urlFragment | ||
---|---|---|---|---|---|---|
sample |
|
|
These samples demonstrate how to use Q# to simulate the Ising model. |
ising |
These samples demonstrate how to use Q# to simulate the Ising model.
- Simple Ising: This sample walks through constructing the time-evolution operator for the Ising model.
- Ising Generators: This sample describes how Hamiltonians may be represented using Microsoft.Quantum.Canon functions.
- Adiabatic Ising Evolution: This sample converts a representation of a Hamiltonian using library data types into unitary time-evolution by the Hamiltonian on qubits.
- Ising Phase Estimation: This sample adiabatically prepares the ground state of the Ising model Hamiltonian, and then perform phase estimation to obtain an estimate of the ground state energy.
- Ising Trotter Evolution: This sample walks through constructing the time-evolution operator for the Ising model using the Trotterization library feature.
- IsingSamples.csproj: Main Q# project for all of the Ising samples.
At a terminal, run the command line listed in the section for each sample below.
Open the simulation.sln
solution in Visual Studio and set the .csproj file in the manifest as the startup project.
Set the command-line arguments to simulate <entry point>
, replacing <entry point>
with the name of the sample's entry point.
Press Start in Visual Studio to run the sample.
This sample walks through constructing the time-evolution operator for the Ising model manually. This time-evolution operator is applied to adiabatically prepare the ground state of the Ising model. The net magnetization is then measured.
dotnet run simulate Microsoft.Quantum.Samples.Ising.RunSimple
- SimpleIsing.qs: Q# code implementing quantum operations for this sample.
- Program.qs: Q# entry point to interact with and print out results of the Q# operations for this sample.
This sample describes how Hamiltonians may be represented using library functions. The Ising model is decomposed into single-site and two-site terms which are added. A simple extension to the Heisenberg model is also illustrated.
dotnet run simulate Microsoft.Quantum.Samples.Ising.RunGenerators
- IsingGenerators.qs: Q# code implementing quantum operations for this sample.
- Program.qs: Q# entry point to interact with and print out results of the Q# operations for this sample.
This sample converts a representation of a Hamiltonian operator using library data types into unitary time-evolution by the Hamiltonian on qubits. We consider the Ising model and study adiabatic state preparation of its ground state for the cases of uniform ferromagnetic and anti-ferromagnetic coupling between sites.
dotnet run simulate Microsoft.Quantum.Samples.Ising.RunAdiabaticEvolution
- AdiabaticIsing.qs: Q# code implementing quantum operations for this sample.
- Program.qs: Q# entry point to interact with and print out results of the Q# operations for this sample.
This sample builds on results in the Ising Generators sample. We suggest reading that sample before continuing.
This sample adiabatically prepares the ground state of the Ising model Hamiltonian, and then perform phase estimation to obtain an estimate of the ground state energy.
dotnet run simulate Microsoft.Quantum.Samples.Ising.RunPhaseEstimation
- IsingPhaseEstimation.qs: Q# code implementing quantum operations for this sample.
- Program.qs: Q# entry point to interact with and print out results of the Q# operations for this sample.
This sample builds on results in Adiabatic Ising Evolution and uses techniques introduced in Ising Phase Estimation. We suggest reading those samples before continuing.
This sample walks through constructing the time-evolution operator for the Ising model using the Trotter–Suzuki decomposition provided with the Q# standard library. This time-evolution operator is applied to investigate spin relaxation.
dotnet run simulate Microsoft.Quantum.Samples.Ising.RunTrotterSuzuki
- IsingTrotter.qs: Q# code implementing quantum operations for this sample.
- Program.qs: Q# entry point to interact with and print out results of the Q# operations for this sample.