QuditSpace¶
- class qugradlab.hilbert_spaces.QuditSpace(basis: ndarray[int])[source]¶
Bases:
HilbertSpace,ABCAn abstract class defining the Hilbert space for a collection of qudits.
Attributes
An array of positive integers labeling the Hilbert space basis
The Hilbert space dimension
An array satisfying the property
self.inverse[self.basis[i]]=iMethods
Initialises a new
HilbertSpace.Returns a column vector represnetation corresponding to the input basis state label.
Initialises a
qugrad.HilbertSpacecorresponding the computation subspace.Dialates an operator \(\hat O\) that acts on the computational subspace to an operator \(\hat O\oplus 0\) that acts on the whole Hilbert space.
Generates a new subspace by filtering the basis state labels.
Generates a string (list of strings) that represent the state(s).
Projects an operator that acts on the Hilbert space to an operator that acts only on the computational subspace.
- __init__(basis: ndarray[int])¶
Initialises a new
HilbertSpace.- Parameters:
basis (NDArray[Shape[
dim], int]) – The labels for the basis vectors.
- basis_vector(basis_state_label: int) ndarray[complex128]¶
Returns a column vector represnetation corresponding to the input basis state label.
- abstractmethod computational_projector() ndarray[bool][source]¶
Important
This is an abstract method.
Generates a boolean filter for the computation basis states in
basis.
- computational_subspace() HilbertSpace[source]¶
Initialises a
qugrad.HilbertSpacecorresponding the computation subspace.- Returns:
The computational subspace
- Return type:
- dialate_operator(operator: ndarray) ndarray[source]¶
Dialates an operator \(\hat O\) that acts on the computational subspace to an operator \(\hat O\oplus 0\) that acts on the whole Hilbert space.
- get_subspace(filter: ndarray[bool]) HilbertSpace¶
Generates a new subspace by filtering the basis state labels.
- Parameters:
filter (NDArray[Shape[
dim], bool]) –Trueentries are retained in the new subspace.- Returns:
The filtered subspace.
- Return type:
HilbertSpace
- labels(states: int | list[int] | None = None) str | list[str]¶
Generates a string (list of strings) that represent the state(s).
- project_operator(operator: ndarray) ndarray[source]¶
Projects an operator that acts on the Hilbert space to an operator that acts only on the computational subspace.
- property dim¶
The Hilbert space dimension