Reference
This is the reference to the public interface of NeuralQuantum.
Hilbert spaces
Methods relative to Hilbert spaces and their states
General methods
NeuralQuantum.nsites — Functionnsites(hilbert) -> IntReturns the number of lattice sites in the Hilbert space.
NeuralQuantum.shape — Functionshape(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.
NeuralQuantum.local_dim — Functionlocal_dim(hilbert [, i]) -> IntReturns the local dimension of the hilbert space on site i. If the space is homogeneous then specifying i is not needed.
NeuralQuantum.spacedimension — Functionspacedimension(hilbert) = prod(shape(hilbert)) -> IntReturns the total dimension of the vector space hilbert. This is only valid if indexable(hilbert) == true, otherwise it's 0.
NeuralQuantum.indexable — Functionindexable(hilbert) -> BoolReturns true if the space is can be indexed with an Int64, which means that htis tests true when
spacedimension(hilbert) <= typemax(Int64)NeuralQuantum.is_homogeneous — Functionis_homogeneous(hilbert) -> BoolReturns true if the space is homogeneous, that is, if all the modes have the same local hilbert space dimension.
Constructors
NeuralQuantum.HomogeneousFock — TypeHomogeneousFock(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.
NeuralQuantum.HomogeneousSpin — TypeHomogeneousSpins(N, S::Rational=1//2)Constructs the Hilbert space of N identical spins-S (by default 1//2).
Working with states
NeuralQuantum.index — Functionindex(hilb, state)Converts to an int the state of the hilbert space hilb assuming it's indexable.
NeuralQuantum.state — Functionstate([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.
NeuralQuantum.states — Functionstates(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.
states(hilb) -> iteratorReturns an iterator to iterate all states in the hilbert space
Missing docstring for Random.rand!. Check Documenter's build log for details.
Missing docstring for Random.rand. Check Documenter's build log for details.
NeuralQuantum.apply! — Functionapply!(σ, 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.
NeuralQuantum.flipat! — Functionflipat!(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.
Missing docstring for NeuralQuantum.setat!. Check Documenter's build log for details.
Missing docstring for NeuralQuantum.local_index. Check Documenter's build log for details.
NeuralQuantum.state_uview — Functionstate_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.
Operators
QuantumOpticsBase.sigmax — Functionsigmax(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.
QuantumOpticsBase.sigmay — Functionsigmay(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.
QuantumOpticsBase.sigmaz — Functionsigmaz(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.
QuantumOpticsBase.sigmap — Functionsigmap(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.
QuantumOpticsBase.sigmam — Functionsigmam(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.
QuantumOpticsBase.create — Functioncreate(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
QuantumOpticsBase.destroy — Functiondestroy(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
NeuralQuantum.KLocalOperator — TypeKLocalOperatorA 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
NeuralQuantum.KLocalOperatorRow — FunctionKLocalOperatorRow(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.
QuantumOpticsBase.liouvillian — Functionliouvillian(Ĥ, 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.