Reference

This is the reference to the public interface of NeuralQuantum.

Hilbert spaces

Methods relative to Hilbert spaces and their states

General methods

NeuralQuantum.shapeFunction
shape(hilbert) -> Vector{Int}

Returns a vector containing the local hilbert space dimensions of every mode in the Hilbert space.

In the case of homogeneous spaces, it is usually more efficient to call local_dim.

source
NeuralQuantum.local_dimFunction
local_dim(hilbert [, i]) -> Int

Returns the local dimension of the hilbert space on site i. If the space is homogeneous then specifying i is not needed.

source
NeuralQuantum.spacedimensionFunction
spacedimension(hilbert) = prod(shape(hilbert)) -> Int

Returns the total dimension of the vector space hilbert. This is only valid if indexable(hilbert) == true, otherwise it's 0.

source
NeuralQuantum.indexableFunction
indexable(hilbert) -> Bool

Returns true if the space is can be indexed with an Int64, which means that htis tests true when

    spacedimension(hilbert) <= typemax(Int64)
source
NeuralQuantum.is_homogeneousFunction
is_homogeneous(hilbert) -> Bool

Returns true if the space is homogeneous, that is, if all the modes have the same local hilbert space dimension.

source

Constructors

NeuralQuantum.HomogeneousFockType
HomogeneousFock(N, m; excitations=N*m)

Constructs the Hilbert space of N identical modes with m levels. If "n_exc" is set, then the total number of excitations is bounded when generating a state.

!!!note If using a sampler that does not respect the symmetries of the system, the n_exc will not be respected during sampling.

source

Working with states

NeuralQuantum.indexFunction
index(hilb, state)

Converts to an int the state of the hilbert space hilb assuming it's indexable.

source
NeuralQuantum.stateFunction
state([arrT=Vector], [T=STD_REAL_PREC], hilbert, [i=0])

Constructs a state for the hilbert space with precision T and array type arrT. By default that's the lowest state, otherwise if the hilbert space it's indexable you can specify with a second argument.

source
NeuralQuantum.statesFunction
states(v::StateCollection)

Returns an iterator to iterate all states in the batch/array of batches v.

By default, the iteration is done using unsafe views for increased performance.

source
states(hilb) -> iterator

Returns an iterator to iterate all states in the hilbert space

source
Missing docstring.

Missing docstring for Random.rand!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Random.rand. Check Documenter's build log for details.

NeuralQuantum.apply!Function
apply!(σ, changes, [changes_r])

Applies the changes changes to the σ.

If state isa DoubleState then single-value changes are applied to the columns of the state (in order to compute matrix-operator products). Otherwise it should be a tuple with changes of row and columns.

If the state is double but there is only 1 element of changes, it's applied to the rows.

If changes is nothing, does nothing.

source
NeuralQuantum.flipat!Function
flipat!(state, hilb, i) -> (old_val, new_val)

Randomly flips state[i] to another available state. Returns the old value of state[i] and the new value. state is changed in-place.

source
Missing docstring.

Missing docstring for NeuralQuantum.setat!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for NeuralQuantum.local_index. Check Documenter's build log for details.

NeuralQuantum.state_uviewFunction
state_uview(state, [batch], el)

Given a vector of batches of states with size size(state) = [:, batches, els], take the batch group el, and if specified also selects one single batch.

Returns an UnsafeArrays.UnsafeView object to avoid allocating.

source

Operators

QuantumOpticsBase.sigmaxFunction
sigmax(hilbert::AbstractHilbert, site::Int)

Builds a σₓ operator acting on the site-th site of the Many body Hilbert space hilbert.

Note: M-dimensional Hilbert spaces are treated as spin (M-1)//2 spins.

source
QuantumOpticsBase.sigmayFunction
sigmay(hilbert::AbstractHilbert, site::Int)

Builds a σ_y operator acting on the site-th site of the Many body Hilbert space hilbert.

Note: Hilbert must have local space dimension 2 on that site.

source
QuantumOpticsBase.sigmazFunction
sigmaz(hilbert::AbstractHilbert, site::Int)

Builds a σ_z operator acting on the site-th site of the Many body Hilbert space hilbert.

Note: M-dimensional Hilbert spaces are treated as spin (M-1)//2 spins.

source
QuantumOpticsBase.sigmapFunction
sigmap(hilbert::AbstractHilbert, site::Int)

Builds a σ₊ operator acting on the site-th site of the Many body Hilbert space hilbert.

Note: M-dimensional Hilbert spaces are treated as spin (M-1)//2 spins.

source
QuantumOpticsBase.sigmamFunction
sigmam(hilbert::AbstractHilbert, site::Int)

Builds a σ₋ operator acting on the site-th site of the Many body Hilbert space hilbert.

Note: M-dimensional Hilbert spaces are treated as spin (M-1)//2 spins.

source
QuantumOpticsBase.createFunction
create(hilbert::AbstractHilbert, site::Int)

Builds a bosonic creation operator acting on the site-th site of the Many body Hilbert space hilbert.

Note: spin-m//2 spaces are treated as fock spaces with dimension m+1

source
QuantumOpticsBase.destroyFunction
destroy(hilbert::AbstractHilbert, site::Int)

Builds a bosonic destruction operator acting on the site-th site of the Many body Hilbert space hilbert.

Note: spin-m//2 spaces are treated as fock spaces with dimension m+1

source
NeuralQuantum.KLocalOperatorType
KLocalOperator

A representation of a local operator, acting on certain sites, each with hilb_dims dimension. The local operator is written in matrix form in this basis as mat. For every row of mat there are several non-zero values contained in mel, and to each of those, to_change contains the sites that must change the basis new value, contained in new_value

source
NeuralQuantum.KLocalOperatorRowFunction
KLocalOperatorRow(sites::Vector, hilb_dims::Vector, operator)

Creates a KLocalOperator where connections are stored by row for the operator operator acting on sites each with hilb_dims local dimension.

source
QuantumOpticsBase.liouvillianFunction
liouvillian(Ĥ, ops::Vector)

Constructs the LocalOperator representation of a liouvillian super-operator with coherent part given by the hamilotnian , and ops as the list of jump operators.

source