hamiltonian_utils
hamiltonian_utils ¶
fetch_h2_gs_data ¶
Returns ground state energy and wavefunction for checking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bond_length
|
float
|
H-H bond length, in Angstroms. |
required |
Returns:
| Type | Description |
|---|---|
g_energy (float
|
Ground state energy. |
g_state (list
|
Ground state wavefunction. |
fetch_h2_gs_prep_angle ¶
Returns ground state preparation circuit parameter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bond_length
|
float
|
H-H bond length, in Angstroms. |
required |
Returns:
| Type | Description |
|---|---|
angle (float
|
Ground state preparation circuit parameter. |
generate_h2_hamiltonian ¶
Generate the hydrogen Haimltonian given a bond length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bond_length
|
float
|
One of |
required |
Returns:
| Type | Description |
|---|---|
PauliSum
|
H2 Hamiltonian. |
get_exactly_representable_qubitized_hamiltonian ¶
Returns a Hamiltonian where \(\arccos(\lambda)\) is exactly representable with bits_of_precision bits.
Note
Only the first excited state of this hamiltonian is guaranteed to be an energy that corresponds to a phase
that is exactly representable using the input bits_of_precision.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha
|
float
|
Arbitrary coefficient which determines the specific type of Hamiltonian. |
required |
bits_of_precision
|
int
|
Number of bits the phase is to be measured to. Must be greater than 2. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[PauliSum, float]
|
The Hamiltonian and the eigenvalue. |
h2_ground_state_prep ¶
Circuit for ground state preparation for H2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qc
|
QPU
|
QPU |
required |
sys_reg
|
Qubits
|
System register to implement state preparation. |
required |
ansatz_param
|
float
|
Ground state prep circuit parameter (in Radians). |
required |
Notes
See Fig. 1 of "Scalable Quantum Simulation of Molecular Energies" (arXiv:1512.06860 ⧉).