Skip to content

bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian

← Module overview

classRydbergHamiltoniansource

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

NameTypeDefaultDescription
emulator_irEmulatorProgramrequired
spaceSpacerequired
rydbergNDArrayrequired
detuning_opsList[DetuningOperator]list()
rabi_opsList[RabiOperator]list()

Attributes

NameTypeDescription
emulator_irEmulatorProgramA copy of the original program used to generate the RydbergHamiltonian
spaceSpaceThe Hilbert space of the Hamiltonian, should align with the register the Hamiltonian is being applied on for average energy/variance
rydbergNDArrayRydberg interaction operator
detuning_opsList[DetuningOperator]Detuning Operators of the Hamiltonian
rabi_opsList[RabiOperator]Rabi Operators of the Hamiltonian

methodaveragesource

bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian.average

Signature
def average(register: StateVector, time: Optional[float] = None) -> float

Get energy average from RydbergHamiltonian object at time time with register register

Parameters

NameTypeDefaultDescription
registerStateVectorrequiredThe state vector to take average with
timeOptional[float]NoneTime value to evaluate average at.

Returns

floatfloat: average energy at time `time`

source

methodaverage_and_variancesource

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

NameTypeDefaultDescription
registerStateVectorrequiredThe state vector to take average and variance with
timeOptional[float]NoneTime value to evaluate average at.

Returns

(float, float)Tuple[float, float]: average and variance of energy at time `time` respectively.

source

methodvariancesource

bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian.variance

Signature
def variance(register: StateVector, time: Optional[float] = None) -> float

Get the energy variance from RydbergHamiltonian object at time time with register register

Parameters

NameTypeDefaultDescription
registerStateVectorrequiredThe state vector to take variance with
timeOptional[float]NoneTime value to evaluate average at.

Returns

floatcomplex: variance of energy at time `time` respectively.

source

methodtocsrsource

bloqade.analog.emulate.ir.state_vector.RydbergHamiltonian.tocsr

def tocsr(time: float) -> csr_matrix

Return the Hamiltonian as a csr matrix at time time.

Parameters

NameTypeDescription
timefloattime to evaluate the Hamiltonian at.

Returns

csr_matrixcsr_matrix: The Hamiltonian as a csr matrix.

source