Skip to content

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
@beartype
def run(
    self,
    shots: int = 1,
    solver_name: str = "dop853",
    atol: float = 1e-14,
    rtol: float = 1e-7,
    nsteps: int = 2_147_483_647,
    interaction_picture: bool = False,
    project_hyperfine: bool = True,
):
    """Run the emulation with all atoms in the ground state,
    sampling the final state vector."""

    options = dict(
        solver_name=solver_name,
        atol=atol,
        rtol=rtol,
        nsteps=nsteps,
        interaction_picture=interaction_picture,
    )

    state = self.hamiltonian.space.zero_state()
    (result,) = self.apply(state, **options)
    result /= np.linalg.norm(result)

    return self.hamiltonian.space.sample_state_vector(
        result, shots, project_hyperfine=project_hyperfine
    )