Creates an operator from sparse entires. This is a low-level method (due to the explicit use of OperatorEntry). You may need Operator.fromArray or Operator.fromSparseCoordNames instead.
Operator entries.
Output dimensions.
Input dimensions. If not specified, assumed to be the same as input dimensions.
Names of the coordinates for each input dimension.
Names of the coordinates for each output dimension.
Input dimension names.
Output dimension names.
The sizes of input dimensions.
The sizes of output dimensions.
The total size of input (a product of all input sizes). It is the matrix column number.
The total size of output (a product of all output sizes). It is the matrix row number.
Elementwise complex conjugation (no transpose!). https://en.wikipedia.org/wiki/Complex_conjugate
A^* - simple conjugate of an operator.
Conjugate transpose (Hermitian transpose, dagger operator). https://en.wikipedia.org/wiki/Conjugate_transpose
a^† Hermitian conjugate of an operator.
Is it close to another operator?
An operator to compare
Euclidean distance tolerance.
Checks M1 ~= M2
Is it close to a Hermitian matrix?
Euclidean distance tolerance.
Checks M^dag ~= M
Is it close to identity?
Euclidean distance tolerance.
Checks M ~= Id
Is it close to a normal operator?
Euclidean distance tolerance.
Checks M^dag M ~= M M^dag
Is it close to a projection?
Euclidean distance tolerance.
Checks M M ~= M
Is it close to an unitary operator?
Euclidean distance tolerance.
Checks M^dag M ~= Id
Is it close to an unitary, when restricted to of the subspace defines by its image. A stronger condition than the partial isometry https://en.wikipedia.org/wiki/Partial_isometry. E.g. spin-up operator |u><d| is a partial isometry, but not unitary on subspace.
Euclidean distance tolerance.
M^dag M ~= M M^dag ~= P, P P = P
Is it close to zero?
Euclidean distance tolerance.
Checks M ~= 0
Multiplies operator by a real number.
A factor.
x M
Perform multiplication on a vector, (M v), on some dimensions. E.g. if there are 3 particles, and you want to apply an operation only on the first: M_0 v. Or if you want to apply an operation on the first and the third: M_02 v. In principle, you can do the same by mutlipying matrices with identities, but wouldnot scale.
Dimension indices at which we perform the opration. They need to be unique.
Vector on which we apply the operation.
M_(coord_indices) ⊗ I_(everywhere_else) v
L2 norm, Frobenius norm, or Hilbert-Schmidt norm. Squared. https://en.wikipedia.org/wiki/Matrix_norm#Frobenius_norm
Outer product between two operators. In this context, same as: Kronecker product and tensor product. https://en.wikipedia.org/wiki/Kronecker_product
Another operator.
m1 ⊗ m2
Partial trace of the operator, X_B = Tr_A[X_AB].
Dimension indices to be reduced.
X_B = Tr_A[X_AB]
Changing order of dimensions for an operator, from [0, 1, 2, ...] to something else.
E.g. [2, 0, 1]
E.g. [2, 0, 1] (be default, same as orderOut)
Changing order of input dimensions for an operator, from [0, 1, 2, ...] to something else.
E.g. [2, 0, 1]
Changing order of output dimensions for an operator, from [0, 1, 2, ...] to something else.
E.g. [2, 0, 1]
Change all dimensions with a given dimName to the desired basis.
'polarization', 'spin' or 'qubit'
basis
Export to a dense array format.
array m[i][j], where i is output index and j in input index.
Export entires into a flatten, sparse list.
E.g. [{i: 2, j: 0, v: Cx(2, 4)}, {i: 5, j: 3, v: Cx(-1, 0)}, ...]
String description of an operator.
complex number format; a choice between ["cartesian", "polar", "polarTau"]
float display precision
entry separator
if to show dimensions and sized
A string like: Operator with 4 entiresof max size [[2,2], [2,2]] with dimensions [[polarization,spin], [polarization,spin]] (1.00 +0.00i) |H,u⟩⟨H,u| + (1.00 +0.00i) |H,d⟩⟨H,d| + (1.00 +0.00i) |V,u⟩⟨V,u| + (1.00 +0.00i) |V,d⟩⟨V,d|
An operator as column (input) vectors. Mostly for internal use (e.g. multiplication).
a sparse array of vector per input
An operator as row (output) vectors. Mostly for internal use (e.g. multiplication).
a sparse array of vector per output.
Trace of the operator, Tr[X].
Tr[X]
Matrix transpose (no cojugation). https://en.wikipedia.org/wiki/Transpose
a^T Transpose of an operator.
Creates an operator from a dense array of complex numbers. It needs dimensions to create the complex structure.
A 2-d array of complex numbers.
Dimensions out.
Dimensions in (if not provided, then the same as out).
If to remove zero value.
The most typically way of creating custom operators, directly from its entries (delivered in a visual form).
A list of entries, using symbols. ['Hu', 'Vu', C(0.5, -1)] -> (0.50 - 1.00i) |H,u⟩⟨V,u|
Output dimensions.
Input dimensions. If not specified, the same as in dimensionsOut.
An operator, as desired.
Creates identity matrix, given dimensions. https://en.wikipedia.org/wiki/Identity_matrix
A list of dimensions.
I
A shift operator in one dimension. Things outside go to zero. https://en.wikipedia.org/wiki/Shift_matrix Useful e.g. for moving particles in position by one.
dimension
an integer (e.g. +1 or -1)
A zero operator for given dimensions. https://en.wikipedia.org/wiki/Zero_matrix
0 (as a matrix)
Generated using TypeDoc
Operator class. A complex number sparse matrix aware of dimensions and tensor structure.