Quantum Toolkit
Our Quantum Toolkit enables high-performance algorithms used in quantum many-body physics to be called natively in Aleph.
Global Constants
| Name | Description |
|---|---|
| as_abstract | Constant object representing the StateInfo option as_abstract. |
| as_basisstate | Constant object representing the StateInfo option as_basisstate. |
| as_complete | Constant object representing the StateInfo option as_complete. |
| as_dense | Constant object representing the StateInfo option as_dense. |
| as_fermion | Constant object representing the StateInfo option as_fermion. |
| as_heterogenous_qdit | Constant object representing the StateInfo option as_heterogenous_qdit. |
| as_inversion | Constant object representing the StateInfo option as_inversion. |
| as_magnetization | Constant object representing the StateInfo option as_magnetization. |
| as_magnetization | as_spin_flip | as_translation | Constant object representing the StateInfo option as_magnetization | as_spin_flip | as_translation. |
| as_magnetization | as_translation | Constant object representing the StateInfo option as_magnetization | as_translation. |
| as_number | Constant object representing the StateInfo option as_number. |
| as_parity | Constant object representing the StateInfo option as_parity. |
| as_qdit | Constant object representing the StateInfo option as_qdit. |
| as_singleparticle | Constant object representing the StateInfo option as_singleparticle. |
| as_sparse | Constant object representing the StateInfo option as_sparse. |
| as_spin_flip | Constant object representing the StateInfo option as_spin_flip. |
| as_spinhalf | Constant object representing the StateInfo option as_spinhalf. |
| as_statevector | Constant object representing the StateInfo option as_statevector. |
| as_translation | Constant object representing the StateInfo option as_translation. |
| as_unknown | Constant object representing the StateInfo option as_unknown. |
| as_unspecified | Constant object representing an unspecified StateInfo option. |
| spectrum | The spectrum selector has methods that return SpectrumItem objects that are used in the context of iterative eigensolvers. These SpectrumItem objects specify which part of the spectrum to target. For instance, one can create a SpectrumItem that targets the largest absolute eigenvalues by calling spectrum.largest_abs. Similarly, spectrum.smallest_real returns a SpectrumItem that targets the smallest real eigenvalues. |
Factories
| Name | Description |
|---|---|
EigsArnoldi | Constructs a EigsArnoldi eigensolver. |
EigsLanczos | Constructs a EigsLanczos eigensolver. |
Heisenberg_1d | Generate the Hamiltonian Matrix Product Operator (MPO) for the 1D Heisenberg model with Real values. |
Ising_1d | Generate the Hamiltonian Matrix Product Operator (MPO) for the 1D transverse-field Ising model with Real values. |
LinearOperator | Constructs an LinearOperator from an Operator. |
PairingSum | The PairingSum operator is parametrized by a sparse matrix of size . Each entry for corresponds to the operator , whilst each entry for corresponds to the operator . The PairingSum operator represents the sum |
QuadraticSum | The QuadraticSum operator is parametrized by a sparse matrix of size . The operator represents the sum with |
Transfer | Returns the directed fermionic transfer operator with support on the specified sites. |
TransferSum | The TransferSum operator is parametrized by a sparse matrix of size . Each entry corresponds to the operator . The TransferSum operator represents the sum . |
accumulator | Factory for constructing accumulators. |
coefficient | Creates a Coefficient that can be added to a Model. |
identity_mpo | Generate an identity Matrix Product Operator (MPO) with Complex values. |
interaction | Constructs an interaction that can be added to a model. |
lattice | Constructor for lattice class. |
lattice_coordinate | Constructor for lattice coordinate. |
matrix | Converts the operator to its matrix representation. |
model | Constructs a model from a .lattice_model file. |
mpo | Convert the supplied Operator to a Matrix Product Operator (MPO) with Complex values. |
neighbourhood_rule | Constructor for a neighbourhood rule. |
operator_free | Generates an operator that represents the hopping terms of the input matrix. |
operator_function | Approximates a matrix function using the Krylov subspace method. |
operator_prod | Creates an empty OperatorProduct. |
operator_stencil | Generates a stencil operator. |
operator_sum | Creates an empty ComplexOperatorSum with complex coefficients (default behavior). |
qbit_range | Creates a range of Qbit objects with the specified number of sites. |
random_mpo | Generate a random Matrix Product Operator (MPO) with Complex values. |
random_mps | Generate a random Matrix Product State (MPS) with Complex values. |
sse_algorithm | Constructs an SSE algorithm instance. |
sse_order_estimator | Constructs the estimator for the order in an SSE simulation. |
state_range | Creates an iterator for a range of state objects matching the provided option. |
state_vector | State vector factory. |
support_table | Constructs a SupportTable from a vector of NeighbourhoodRule and a Lattice. |
Operators
| Name | Description |
|---|---|
CNOT | Returns a spin-1/2 Operator for the CNOT (controlled-NOT) gate, taking two individual site indices. |
CoulombSum | Returns a Coulomb tensor operator sum . |
Create | Returns the fermionic creation operator with support on the specified site. |
CreateCreate | Returns the pairing term with support on the specified sites. |
Destroy | Returns the fermionic annihilation operator with support on the specified site. |
DestroyDestroy | Returns the pairing term with support on the specified sites. |
DoubleExcitation | Legacy alias for PairHop. Returns the pair hopping operator with support on the specified sites. |
DualUnitary | Returns a spin-1/2 dual unitary operator: where are the site indices. |
Flip | Creates a spin-1/2 Operator that flips the spin at a single site. |
FlipAll | Creates a spin-1/2 Operator that flips all spins. |
Floquet | Returns a spin-1/2 Floquet where are the site indices. |
FourBody | Legacy alias for PairTransfer. Returns the directed pair transfer operator with support on the specified sites. |
Hgate | Returns a spin-1/2 Operator for the Hadamard gate. |
Hop | Returns the fermionic hopping operator with support on the specified sites. |
HopNumber | Returns the hop-number operator with support on the specified sites. |
ModeRotation | Returns the mode rotation operator with support on the specified sites. |
NearestNumberSum | Returns the sum of nearest-neighbor number interactions with support on the specified sites. |
NextNearestNumberSum | Returns the sum of next-nearest-neighbor number interactions with support on the specified sites. |
Number | Returns the fermionic number operator with support on the specified site. |
NumberN | Legacy alias for NumberSum. Returns the sum of fermionic number operators with support on the specified sites. |
NumberNumber | Returns the two-site fermionic number-number interaction operator with support on the specified sites. |
NumberNumberNN | Legacy alias for NearestNumberSum. Returns the sum of nearest-neighbor number interactions with support on the specified sites. |
NumberNumberNNN | Legacy alias for NextNearestNumberSum. Returns the sum of next-nearest-neighbor number interactions with support on the specified sites. |
NumberNumberPhase | Returns the two-site number-number phase operator with support on the specified sites. |
NumberPhase | Returns the site number phase operator with support on the specified site. |
NumberPotential | Returns an operator representing a weighted sum of number operators , where the site indices are implicitly . If a subset of sites or a different ordering is desired, use the factory overload that accepts an explicit list of site indices. |
NumberSum | Returns the sum of fermionic number operators with support on the specified sites. |
PairHop | Returns the pair hopping operator with support on the specified sites. |
PairHopSum | Returns a generalized pair hopping tensor operator . |
PairRotation | Returns the pair rotation operator with support on the specified sites. |
PairTransfer | Returns the directed pair transfer operator with support on the specified sites. |
Permute | Creates a spin-1/2 Operator that permutes spins according to a specified permutation. |
Phase | Returns a global phase spin-1/2 operator(\phi) = e^{-i\phi}$. |
PhaseHop | Returns the complex phase-hop operator with support on the specified sites. |
PhaseShift | Returns a spin-1/2 PhaseShift on the state. |
Proj0 | Returns a spin-1/2 Operator for the projector . |
Proj1 | Returns a spin-1/2 Operator for the projector . |
Reflect | Creates a spin-1/2 Operator that reflects all spins about the center. |
RotEuler | Returns a general spin-1/2 rotation operator RotEuler. |
RotX | Returns a spin-1/2 RotX rotation operator around the X-axis. |
RotY | Returns a spin-1/2 RotY rotation operator around the Y-axis. |
RotZ | Returns a spin-1/2 RotZ rotation operator around the Z-axis. |
SWAP | Returns a spin-1/2 Operator for the SWAP gate, taking two individual site indices. |
SX | Returns \f as a scaled operator sum. |
SY | Returns \f as a scaled operator sum. |
SZ | Returns \f as a scaled operator sum. |
Sgate | Returns a spin-1/2 Operator for the S gate. |
Sminus | Returns a spin-1/2 Operator for Spin-minus operator. |
Splus | Returns a spin-1/2 Operator for Spin-plus operator. |
Tgate | Returns a spin-1/2 Operator for the T gate. |
TransferNumber | Returns the transfer-number operator with support on the specified sites. |
Translate | Creates a spin-1/2 Operator that translates spins by a specified shift. |
UnitaryXYZ | Returns a spin-1/2 UnitaryXYZ operator: where are the site indices. |
X | Returns a spin-1/2 Operator for Pauli-X operator. |
XX | Returns a spin-1/2 Operator for operator, taking two individual site indices. |
XXPYY | Returns a spin-1/2 Operator for operator, taking two individual site indices. |
Y | Returns a spin-1/2 Operator for Pauli-Y operator. |
YY | Returns a spin-1/2 Operator for operator, taking two individual site indices. |
Z | Returns a spin-1/2 Operator for Pauli-Z operator. |
ZN | Returns a spin-1/2 Operator for operator. |
ZZ | Returns a spin-1/2 Operator for operator, taking two individual site indices. |
ZZNN | Returns a spin-1/2 Operator for operator. |
ZZNNN | Returns a spin-1/2 Operator for operator. |
operator_dense | Returns a spin-1/2 Operator parametrized by the given matrix. |
operator_diagonal | Returns a spin-1/2 diagonal operator with specified diagonal elements. |
operator_generic | Creates a spin-1/2 Operator from a string representation. |
operator_sparse | Returns a spin-1/2 Operator parametrized by the given matrix. |
pauli_string | Creates a spin-1/2 Operator from a string representation. |
Types
| Name | Description |
|---|---|
| Accumulator | Base class for all accumulators. |
| BasisState | Represents a quantum product state \vert s_1s_2...s_n\rangle. |
| BinningAccumulator | Accumulator that stores bin means. |
| Coefficient | Represents a coefficient in a model that multiplies a interaction. Can be either a real number of a function of a list of lattice coordinates returning a real number. |
| CoefficientFactory | A function of a List of LatticeCoordinate that returns a real number. |
| CoefficientFunction | A function taking a list of coordinates and returning a complex number. |
| ComplexChebyshevSeries | A ComplexChebyshevSeries-valued Chebyshev series. |
| ComplexFreeMatrix | This operator efficiently represents a sum of fermionic hopping and number operators. It is designed to provide efficient kernels for solving single particle (free) fermionic problems. |
| ComplexFreeStencil | This operator is designed to provide efficient methods for calculations involving a structured free operator (single particle symmetry sector of a fermionic Hilbert space). A free operator which can be written as a stencil assumes the general form where are displacement vectors, are lattice position vectors, the are position independent coefficients and is the number of such coefficients. To construct a stencil, the above parameters must be passed explicitly, together with information about the lattice dimensions and the boundary conditions. For more details, please see the operator_free factory. |
| ComplexMPO | Matrix Product Operator (MPO) of Complex values. Compressed representation of large-dimensional tensors, well suited to the representation of quantum operators for 1D many-body physics problems. |
| ComplexMPS | Matrix Product State (MPS) of Complex values. Compressed representation of a large-dimensional tensor, well suited for state vectors of some 1D many-body quantum mechanics problems. |
| ComplexOperatorChebyshevSeries | A ComplexOperatorChebyshevSeries defined by applying a scalar-valued Chebyshev series to an operator. For example, a series p(x) = sum_n a_n T_n(x) becomes p(A) = sum_n a_n T_n(A) when applied to an operator A. |
| ComplexOperatorPolynomial | A ComplexOperatorPolynomial defined by a scalar polynomial applied to an operator. For example, a polynomial p(x) = sum_n a_n x^n becomes p(A) = sum_n a_n A^n when applied to an operator A. |
| ComplexOperatorSum | Represents a sum of operators with complex scalar coefficients. Each term consists of a complex coefficient and an operator. Create instances using the operator_sum() factory function. |
| ComplexPolynomial | A ComplexPolynomial-valued polynomial. |
| Constraint | A function taking in a lattice coordinate and returning a Boolean that specifies when a given lattice coordinate is a valid reference for a neighbourhood. |
| EigsArnoldi<LinearOperator<complex>> | EigsArnoldi iterative eigensolver. |
| EigsArnoldi<LinearOperator<real>> | EigsArnoldi iterative eigensolver. |
| EigsBase | Base class for iterative eigensolvers. |
| EigsLanczos<LinearOperator<complex>> | EigsLanczos iterative eigensolver. |
| EigsLanczos<LinearOperator<real>> | EigsLanczos iterative eigensolver. |
| EigsOptions | Configuration options stored by iterative eigensolvers. |
| EigsStatus | Runtime status returned by an iterative eigensolver. |
| Estimate | Statistical estimate from binned values containing value of estimate and variance on the value. |
| Estimator | Base class for estimators. |
| Fbit | An object representing a product state of fermionic modes. |
| FbitRange | A range of Fbit objects. |
| FermionOperator | Base class for all fermionic quantum operators. |
| HeterogenousQdit | Qdit type. |
| HomogenousQdit | Qdit type. |
| Interaction | Represents a interaction in a model storing a coefficient name, a list of functions to produce an operator product, and the name of a neighbourhood rule. |
| Interval | Represents a closed interval [a, b] of real numbers. |
| Lattice | Class that represents a crystal lattice (Bravais lattice and atomic basis) |
| LatticeCoordinate | Represents a lattice coordinate in terms of primitive indices and a basis index. |
| LatticeRange | A range of lattice coordinates used to iterate over lattice coordinates. |
| LinearOperator<complex> | Spectra operator wrapper for complex-valued operators. |
| LinearOperator<real> | Spectra operator wrapper for real-valued operators. |
| List<AlephSingleSiteOperatorFactory> | A list of single site operator factories. |
| List<Fbit> | A list of Fbit objects. |
| List<HeterogenousQdit> | A list of HeterogenousQdit objects. |
| List<HomogenousQdit> | A list of HomogenousQdit objects. |
| List<Qbit> | A list of Qbit objects. |
| LogarithmicAccumulator | Accumulator that logarithmically bins accumulated values. |
| Model | Stores the interactions of a lattice Hamiltonian and associated observables in interactions of lattice coordinates and neighbourhoods. |
| NeighbourhoodRule | A representation of a neighbourhood of a given LatticeCoordinate on a Lattice |
| NoBinningAccumulator | Accumulator that doesn't bin values. |
| Operator | Base class for all quantum operators. |
| OperatorProduct | Represents a product of operators without scalar coefficients. For products with coefficients (e.g., 2.0*X(0)*Y(1)), use OperatorSum instead. Create instances using the operator_prod() factory function. |
| PauliString | Object that represents a numerically efficient Pauli String |
| PauliStringSum | Object that represents a sum of Pauli strings. |
| Qbit | An object representing a product state of qubits. |
| QbitRange | A range of Qbit objects. |
| RealChebyshevSeries | A RealChebyshevSeries-valued Chebyshev series. |
| RealFreeMatrix | This operator efficiently represents a sum of fermionic hopping and number operators. It is designed to provide efficient kernels for solving single particle (free) fermionic problems. |
| RealFreeStencil | This operator is designed to provide efficient methods for calculations involving a structured free operator (single particle symmetry sector of a fermionic Hilbert space). A free operator which can be written as a stencil assumes the general form where are displacement vectors, are lattice position vectors, the are position independent coefficients and is the number of such coefficients. To construct a stencil, the above parameters must be passed explicitly, together with information about the lattice dimensions and the boundary conditions. For more details, please see the operator_free factory. |
| RealMPO | Matrix Product Operator (MPO) of Real values. Compressed representation of large-dimensional tensors, well suited to the representation of quantum operators for 1D many-body physics problems. |
| RealMPS | Matrix Product State (MPS) of Real values. Compressed representation of a large-dimensional tensor, well suited for state vectors of some 1D many-body quantum mechanics problems. |
| RealOperatorChebyshevSeries | A RealOperatorChebyshevSeries defined by applying a scalar-valued Chebyshev series to an operator. For example, a series p(x) = sum_n a_n T_n(x) becomes p(A) = sum_n a_n T_n(A) when applied to an operator A. |
| RealOperatorPolynomial | A RealOperatorPolynomial defined by a scalar polynomial applied to an operator. For example, a polynomial p(x) = sum_n a_n x^n becomes p(A) = sum_n a_n A^n when applied to an operator A. |
| RealOperatorSum | Represents a sum of operators with real scalar coefficients. Each term consists of a real coefficient and an operator. Create instances using the operator_sum() factory function. |
| RealPolynomial | A RealPolynomial-valued polynomial. |
| SSEAlgorithm | SSE algorithm manager for stochastic series expansion. |
| SSEOperatorString | Represents the operator string in the SSE simulation. |
| SSEOperatorStringEntry | Represents a single entry in the SSE operator string. |
| SSEOrderEstimator | Estimator for the order of the stochastic series expansion |
| SSEVertex | Vertex used in the stochastic series expansion Monte Carlo. |
| SingleAccumulator | Base class for all accumulators. |
| SingleSiteOperatorFactory | A function taking an index corresponding to a site on a lattice and returning an Operator. |
| SpectrumItem | Target spectrum enumerator for iterative eigensolvers. Iterative eigensolvers target specific parts of the spectrum. The allowed values are:... |
| SpinHalfOperator | Base class for spin-1/2 symbolic operators. |
| State | Base class for all quantum state representations. |
| StateInfo | An object representing the combination of a set of mutually compatible options. It is used in conjunction with the state_vector factory to specify the desired state. |
| StateVector | Base class for all state vector representations. |
| StateVector<as_complex,as_dense> | A class representing a state vector. The object stores a set of coefficients corresponding to the multiplicative coefficients in front of each computational basis state that for the basis of the state vector. It provides various optimized quantum routines and is compatible with any spin half operator. |
| StateVector<as_real,as_dense> | A class representing a state vector. The object stores a set of coefficients corresponding to the multiplicative coefficients in front of each computational basis state that for the basis of the state vector. It provides various optimized quantum routines and is compatible with any spin half operator. |
| SupportTable | Stores the linear indices associated with some number of name neighbourhoods. |
Module Functions
| Name | Description |
|---|---|
| Heisenberg | Returns a Heisenberg model Hamiltonian: . |
| Identity | Returns the identity operator. |
| SupportTable | Constructs a SupportTable from a vector of NeighbourhoodRule and a Lattice. |
| Zero | Returns the zero operator. |
| anticommuted | Calculates the anticommutation of two named fermionic operators. For inputs A,B the function returns {A,B} - BA. |
| both_ends | Returns the both_ends enum value. |
| canonicalized | Orders the operators in a product of creation and annihilation operators into canonical order. |
| canonicalized_by_site | Orders the operators in a product of creation and annihilation operators into site canonical order. |
| chebyshev_series_delta | Generates a Chebyshev series that approximates a delta function over the specified interval. |
| coefficient_matrix | Creates a bipartite coefficient matrix from a single state vector using arbitrary subsystem cuts. |
| commutator | Computes the commutator of two quantum operators [A,B] = AB - BA. Returns zero operator for identical operators or operators acting on disjoint sites. |
| convert_to_operator_sum | Converts a PauliStringSum to a ComplexOperatorSum. |
| convert_to_pauli_sum | Converts an Operator expression to a PauliStringSum. Only identity and Pauli X, Y, and Z operators are accepted. |
| converted_to_create_destroy | Converts a sum or product of named fermion operators to their equivalent representation in terms of creation and annihilation operators. |
| dmrg | Compute the ground state of a quantum many-body system using the Density Matrix Renormalization Group (DMRG) algorithm. |
| dmrg0s | Compute a ground state using the zero-site (single-site) Density Matrix Renormalization Group algorithm. |
| evolve_suzuki4 | Evolve a complex vector state using 4th-order Suzuki-Trotter. |
| fbit_range | Creates a range of Fbit objects with the specified number of sites. |
| fermionic_site_reorder | Reorders sum or products of creation and annihilation operators in place by site while preserving order on each site. |
| flatten | Flattens any operator by expanding all expressions into a sum of products (in-place). |
| flattened | Flattens any operator by expanding all expressions into a sum of products (out-of-place). |
| fused_into_number | Fuses the appropriate creation and annihilation operators into number operators. |
| haar_matrix | Generate a square Haar random unitary matrix of a specified size. |
| haar_vector | Generates a Haar random vector of a specified size. |
| heisenberg_2qubit_unitary | Compute the 2-qubit Heisenberg unitary evolution. |
| integer | Returns the integer representation of the fermionic product state. |
| interval | Constructs an interval [lower, upper]. |
| is_disjoint_support | Returns true if operators act on non-overlapping sites (commute). |
| iterative_eigensolver | Iterative eigensolver for operators. |
| kron | Returns the tensor product of two fermionic product states. |
| largest_abs | Returns the largest_abs enum value. |
| largest_imag | Returns the largest_imag enum value. |
| largest_real | Returns the largest_real enum value. |
| lattice_range | Constructs a LatticeRange. |
| merge | Simplifies an OperatorSum by combining like terms (in-place). |
| merged | Simplifies an OperatorSum by combining like terms (out-of-place). |
| neighbourhood_rule | Constructor for a neighbourhood rule. |
| prune | Prunes operators from an OperatorSum based on their effective norm (in-place). |
| pruned | Prunes operators from an OperatorSum based on their effective norm (out-of-place). |
| reduced_density_matrix | Calculates the reduced density matrix for a subsystem using arbitrary subsystem cuts. |
| reduced_number_power | Reduces powers of the number operator on the same site to at most 1. |
| renyi_entropy | Calculates the Rényi entropy of order q for a density matrix. |
| reorder_by_site | Reorders operators within a product by their site indices while preserving quantum commutation rules. |
| simplified_create_destroy | Simplifies and reorders a product of creation and annihilation operators by site while preserving site order. Terms are killed if there are too many creation or annihilation operators. |
| simplify_paulis | Simplifies a sum or product of Pauli operators according to Pauli algebra rules with complex coefficients, pruning terms with a coefficient of norm equal to machine precision.Applies commutation relations: X*Y = iZ, Y*Z = iX, Z*X = iY, and P*P = I for any Pauli operator P. Handles multi-site operators and automatically combines like terms. |
| smallest_abs | Returns the smallest_abs enum value. |
| smallest_imag | Returns the smallest_imag enum value. |
| smallest_real | Returns the smallest_real enum value. |
| sse_algorithm | Reads an SSE algorithm from the group at the given path. |
| sse_order_estimator | Constructs the estimator for the order in an SSE simulation. |
| sse_vertex | Constructs a general SSE vertex. |
| string | Converts an EigsStatus object to a string. |
| von_neumann_entropy | Calculates the von Neumann entropy of a density matrix. |
| write | Writes an SSE algorithm relative to the group and returns the group for chaining. |
Module Symbols
| Name | Description |
|---|---|
!= | Returns true if the lattice coordinates are not equal. |
* | Scalar multiplication operator for Polynomial objects. |
*= | Multiplies a PauliStringSum by a scalar in place. |
+ | Adds two PauliStringSums. |
+= | Adds another PauliStringSum in place. |
= | Assigns one PauliStringSum to another. |
== | Returns true if the two StateInfo options are equivalent. |
[] | Array access operator with Fbit states. |
| | Combines two compatible StateInfo options. |