bloqade.analog.emulate.ir.state_vector.StateVector
← Module overview
class
method
sourcemethod
sourcemethod
method
classStateVector¶source
bloqade.analog.emulate.ir.state_vector.StateVector
class StateVector(data: NDArray, space: Space)Parameters
| Name | Type | Description |
|---|---|---|
data | NDArray | |
space | Space |
Attributes
| Name | Type | Description |
|---|---|---|
data | NDArray | |
space | Space |
methodlocal_trace¶source
bloqade.analog.emulate.ir.state_vector.StateVector.local_trace
Signature
def local_trace(matrix: np.ndarray, site_index: Union[int, Tuple[int, int]]) -> complexreturn trace of an operator over the StateVector.
Parameters
| Name | Type | Description |
|---|---|---|
matrix | np.ndarray | Square matrix representing operator in the local hilbert space. |
site_index | Union[int, Tuple[int, int]] | sites to apply one body operator to. |
Returns
complexcomplex: the trace of the operator over the state-vector.
Raises
| Type | Description |
|---|---|
ValueError | Error is raised when the dimension of `operator` is not |
ValueError | Error is raised when the `site` argument is out of bounds. |
methodsample¶source
bloqade.analog.emulate.ir.state_vector.StateVector.sample
def sample(shots: int, project_hyperfine: bool = True) -> NDArraySample the state vector and return bitstrings.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
shots | int | required | |
project_hyperfine | bool | True |
Returns
NDArray
methodnormalize¶source
bloqade.analog.emulate.ir.state_vector.StateVector.normalize
methodnorm¶source
bloqade.analog.emulate.ir.state_vector.StateVector.norm