State vector
AnalogGate dataclass
¶
run ¶
run(
shots=1,
solver_name="dop853",
atol=1e-14,
rtol=1e-07,
nsteps=2147483647,
interaction_picture=False,
project_hyperfine=True,
)
Run the emulation with all atoms in the ground state, sampling the final state vector.
Source code in src/bloqade/emulate/ir/state_vector.py
RydbergHamiltonian dataclass
¶
Hamiltonian for a given task. With the RydbergHamiltonian
you can convert the Hamiltonian to CSR matrix form as well as obtaining the average energy/variance of a register.
Attributes:
Name | Type | Description |
---|---|---|
emulator_ir | EmulatorProgram | A copy of the original program used to generate the RydbergHamiltonian |
space | Space | The Hilbert space of the Hamiltonian, should align with the register the Hamiltonian is being applied on for average energy/variance |
rydberg | NDArray | Rydberg interaction operator |
detuning_ops | List[DetuningOperator] | Detuning Operators of the Hamiltonian |
rabi_ops | List[RabiOperator] | Rabi Operators of the Hamiltonian |
average ¶
Get energy average from RydbergHamiltonian object at time time
with register register
Parameters:
Name | Type | Description | Default |
---|---|---|---|
register | StateVector | The state vector to take average with | required |
time | Optional[float] | Time value to evaluate average at. | None |
Returns:
Name | Type | Description |
---|---|---|
float | float | average energy at time |
Source code in src/bloqade/emulate/ir/state_vector.py
average_and_variance ¶
Get energy average and variance from RydbergHamiltonian object at time time
with register register
Parameters:
Name | Type | Description | Default |
---|---|---|---|
register | StateVector | The state vector to take average and variance with | required |
time | Optional[float] | Time value to evaluate average at. | None |
Returns:
Type | Description |
---|---|
float | Tuple[float, float]: average and variance of energy at time |
float | respectively. |
Source code in src/bloqade/emulate/ir/state_vector.py
tocsr ¶
Return the Hamiltonian as a csr matrix at time time
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time | float | time to evaluate the Hamiltonian at. | required |
Returns:
Name | Type | Description |
---|---|---|
csr_matrix | csr_matrix | The Hamiltonian as a csr matrix. |
Source code in src/bloqade/emulate/ir/state_vector.py
variance ¶
Get the energy variance from RydbergHamiltonian object at time time
with register register
Parameters:
Name | Type | Description | Default |
---|---|---|---|
register | StateVector | The state vector to take variance with | required |
time | Optional[float] | Time value to evaluate average at. | None |
Returns:
Name | Type | Description |
---|---|---|
complex | float | variance of energy at time |
Source code in src/bloqade/emulate/ir/state_vector.py
StateVector dataclass
¶
local_trace ¶
return trace of an operator over the StateVector.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix | ndarray | Square matrix representing operator in the local hilbert space. | required |
site_index | int | Tuple[int, int] | sites to apply one body operator to. | required |
Returns:
Name | Type | Description |
---|---|---|
complex | complex | the trace of the operator over the state-vector. |
Raises:
Type | Description |
---|---|
ValueError | Error is raised when the dimension of |
ValueError | Error is raised when the |
Source code in src/bloqade/emulate/ir/state_vector.py
norm ¶
normalize ¶
sample ¶
Sample the state vector and return bitstrings.