bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian
classRydbergHamiltonian¶source
bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian
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.
Signature
class RydbergHamiltonian(emulator_ir: EmulatorProgram, space: Space, rydberg: NDArray, detuning_ops: List[DetuningOperator] = list(), rabi_ops: List[RabiOperator] = list())Parameters
| Name | Type | Default | Description |
|---|---|---|---|
emulator_ir | EmulatorProgram | required | |
space | Space | required | |
rydberg | NDArray | required | |
detuning_ops | List[DetuningOperator] | list() | |
rabi_ops | List[RabiOperator] | list() |
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 |
methodaverage¶source
bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian.average
Signature
def average(register: StateVector, time: Optional[float] = None) -> floatGet energy average from RydbergHamiltonian object at time time with
register register
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
register | StateVector | required | The state vector to take average with |
time | Optional[float] | None | Time value to evaluate average at. |
Returns
floatfloat: average energy at time `time`
methodaverage_and_variance¶source
bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian.average_and_variance
Signature
def average_and_variance(register: StateVector, time: Optional[float] = None) -> Tuple[float, float]Get energy average and variance from RydbergHamiltonian object at time time
with register register
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
register | StateVector | required | The state vector to take average and variance with |
time | Optional[float] | None | Time value to evaluate average at. |
Returns
(float, float)Tuple[float, float]: average and variance of energy at time `time` respectively.
methodvariance¶source
bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian.variance
Signature
def variance(register: StateVector, time: Optional[float] = None) -> floatGet the energy variance from RydbergHamiltonian object at
time time with register register
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
register | StateVector | required | The state vector to take variance with |
time | Optional[float] | None | Time value to evaluate average at. |
Returns
floatcomplex: variance of energy at time `time` respectively.
methodtocsr¶source
bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian.tocsr
def tocsr(time: float) -> csr_matrixReturn the Hamiltonian as a csr matrix at time time.
Parameters
| Name | Type | Description |
|---|---|---|
time | float | time to evaluate the Hamiltonian at. |
Returns
csr_matrixcsr_matrix: The Hamiltonian as a csr matrix.