microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
library/chemistry/src/JordanWigner/Data.qs
38lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | export JWOptimizedHTerms; |
| 5 | export JWInputState; |
| 6 | export JWEncodingData; |
| 7 | |
| 8 | import Std.Math.*; |
| 9 | |
| 10 | import Generators.EvolutionGenerator; |
| 11 | |
| 12 | /// # Summary |
| 13 | /// Format for a four term Jordan-Wigner optimized Hamiltonian. |
| 14 | /// The meaning of the data represented is determined by the algorithm that receives it. |
| 15 | struct JWOptimizedHTerms { |
| 16 | HTerm0 : (Int[], Double[])[], |
| 17 | HTerm1 : (Int[], Double[])[], |
| 18 | HTerm2 : (Int[], Double[])[], |
| 19 | HTerm3 : (Int[], Double[])[], |
| 20 | } |
| 21 | |
| 22 | /// # Summary |
| 23 | /// Represents preparation of the initial state |
| 24 | /// The meaning of the data represented is determined by the algorithm that receives it. |
| 25 | struct JWInputState { |
| 26 | Amplitude : Complex, |
| 27 | FermionIndices : Int[], |
| 28 | } |
| 29 | |
| 30 | /// # Summary |
| 31 | /// Format of data to represent all information for Hamiltonian simulation. |
| 32 | /// The meaning of the data represented is determined by the algorithm that receives it. |
| 33 | struct JWEncodingData { |
| 34 | NumQubits : Int, |
| 35 | Terms : JWOptimizedHTerms, |
| 36 | InputState : (Int, JWInputState[]), |
| 37 | EnergyOffset : Double, |
| 38 | } |
| 39 | |