FermionQuditSpace

class qugradlab.hilbert_spaces.fermionic.FermionQuditSpace(sites: int, levels_per_site: int, n_particles: int)[source]

Bases: FixedParticleFermionSpace, QuditSpace

A FixedParticleFermionSpace with a computational structure. The Hilbert space is split into the tensor product of sites (qudits), with each site hosting a specified number of levels. The computational subspace consists of the single occupation states that only have particles occupying the lowest two levels.

Attributes

basis

An array of positive integers labeling the Hilbert space basis

dim

The Hilbert space dimension

inverse

An array satisfying the property self.inverse[self.basis[i]]=i

levels_per_site

The number of states per site (qudit)

n_particles

The number of particles

n_single_particle_states

The number of single particle states a fermion can take on

sites

The number of sites (qudits)

Methods

__init__

Initialises a FermionQuditSpace.

basis_vector

Returns a column vector represnetation corresponding to the input basis state label.

computational_projector

Generates a boolean filter for the computation basis states in basis.

computational_subspace

Initialises a qugrad.HilbertSpace corresponding the computation subspace.

dialate_operator

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

Generates a new subspace by filtering the basis state labels.

labels

Generates a string (list of strings) that represent the state(s).

n_occupation_states

Returns a boolean array indicating whether each of the basis states has at most the specified occupation.

project_operator

Projects an operator that acts on the Hilbert space to an operator that acts only on the computational subspace.

single_occupation_states

Returns a boolean array indicating whether each of the basis states is a single occupation state (each site has exactly one particle).

__init__(sites: int, levels_per_site: int, n_particles: int)[source]

Initialises a FermionQuditSpace.

Parameters:
  • sites (int) – The number of sites (qudits)

  • levels_per_site (int) – The number of states per site (qudit)

  • n_particles (int) – The number of particles

basis_vector(basis_state_label: int) ndarray[complex128]

Returns a column vector represnetation corresponding to the input basis state label.

Parameters:

basis_state_label (int) – A positive integer denoting the label of the basis state to generate the basis vector for.

Returns:

The basis vector corresponding to the input basis state label.

Return type:

NDArray[Shape[dim], np.complex128]

computational_projector() ndarray[bool][source]

Generates a boolean filter for the computation basis states in basis. The computational subspace consists of the single occupation states that only have particles occupying the lowest two levels.

Returns:

A boolean filter for the computation basis states in basis.

Return type:

NDArray[Shape[dim], bool]

computational_subspace() HilbertSpace

Initialises a qugrad.HilbertSpace corresponding the computation subspace.

Returns:

The computational subspace

Return type:

qugrad.HilbertSpace

dialate_operator(operator: ndarray) ndarray

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.

Parameters:

operator (NDArray[Shape[computational_subspace().dim, computational_subspace().dim] complex]) – The operator that acts on the computational subspace

Returns:

The dialated operator that acts on the whole Hilbert space

Return type:

NDArray[Shape[dim, dim] complex]

get_subspace(filter: ndarray[bool]) HilbertSpace

Generates a new subspace by filtering the basis state labels.

Parameters:

filter (NDArray[Shape[dim], bool]) – True entries 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).

Parameters:

states (int | list[int], optional) – The state(s) to label. If None then the labels for all states in basis are returned. By default None.

Returns:

The label(s) for the specified states.

Return type:

str | list[str]

n_occupation_states(occupation: int) ndarray[bool][source]

Returns a boolean array indicating whether each of the basis states has at most the specified occupation.

Parameters:

occupation (int) – The occupation to check the basis states for.

Returns:

A boolean array indicating whether each of the basis states has at most the specified occupation.

Return type:

NDArray[Shape[dim], bool]

Note

single_occupation_states() is only equivalent to n_occupation_states(1) when n_particles is greater than or equal to sites.

project_operator(operator: ndarray) ndarray

Projects an operator that acts on the Hilbert space to an operator that acts only on the computational subspace.

Parameters:

operator (NDArray[Shape[dim, dim] complex]) – The operator that acts on the whole Hilbert space

Returns:

The projected operator that acts on the computational subspace.

Return type:

NDArray[Shape[computational_subspace().dim, computational_subspace().dim] complex]

single_occupation_states() ndarray[bool][source]

Returns a boolean array indicating whether each of the basis states is a single occupation state (each site has exactly one particle).

Returns:

A boolean array indicating whether each of the basis states is a single occupation state.

Return type:

NDArray[Shape[dim], bool]

property basis: ndarray[int]

An array of positive integers labeling the Hilbert space basis

property dim

The Hilbert space dimension

property inverse: ndarray[int]

An array satisfying the property self.inverse[self.basis[i]]=i

property levels_per_site: int

The number of states per site (qudit)

property n_particles: int

The number of particles

property n_single_particle_states: int

The number of single particle states a fermion can take on

property sites: int

The number of sites (qudits)