Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Latest commit

 

History

History

ising

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
page_type languages products description urlFragment
sample
qsharp
qdk
These samples demonstrate how to use Q# to simulate the Ising model.
ising

Ising Model Simulation Samples

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.

Manifest

Running the Samples

In Visual Studio Code or the Command Line

At a terminal, run the command line listed in the section for each sample below.

In Visual Studio 2019

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.

Simple Ising 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.

Command Line

dotnet run simulate Microsoft.Quantum.Samples.Ising.RunSimple

Manifest

  • 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.

Ising Generators 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.

Command Line

dotnet run simulate Microsoft.Quantum.Samples.Ising.RunGenerators

Manifest

  • 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.

Adiabatic Ising Evolution 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.

Command Line

dotnet run simulate Microsoft.Quantum.Samples.Ising.RunAdiabaticEvolution

Manifest

  • 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.

Related Samples

This sample builds on results in the Ising Generators sample. We suggest reading that sample before continuing.

Ising Phase Estimation Sample

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.

Command Line

dotnet run simulate Microsoft.Quantum.Samples.Ising.RunPhaseEstimation

Manifest

  • 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.

Related Samples

This sample builds on results in Adiabatic Ising Evolution and uses techniques introduced in Ising Phase Estimation. We suggest reading those samples before continuing.

Ising Trotter-Suzuki Sample

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.

Command Line

dotnet run simulate Microsoft.Quantum.Samples.Ising.RunTrotterSuzuki

Manifest

  • 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.