Creates a vector entry. This is a low-level method (due to the explicit use of VectorEntry). You may need Vector.fromArray or Vector.fromSparseCoordNames instead.
Vector entries.
Dimensions.
Coordinate names for each Dimension.
Dimension names.
Vector norm (vector length). In quantum physics, it is probability of a quantum state.
sqrt⟨v|v⟩
Sizes of dimensions.
The total size (the total array length). FIXME: size and totalSize is confusing, rename to length or size, sizes?
Complex conjugation. Note that that for quantum states it is essentially ket <-> bra, i.e. |psi⟩^† = ⟨psi|
Complex conjugation for a vector.
Create a copy of the vector.
Inner product, the classic ⟨bra|ket⟩ for complex vectors. https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation It is anti-linear in the first argument, and linear in the second.
The other vector (ket).
v1^† . v2 or ⟨v1|v2⟩
Inner product, the classic ⟨bra_indices|ket⟩ for complex vectors. https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation It is anti-linear in the first argument, and linear in the seconf.
The other vector (ket).
|v2⟩_reduced = v1_indices^† . v2 or ⟨v1_indices|v2⟩
Is it close to zero?
Euclidean distance tolerance.
Checks v ~= 0
Multiplies vector by a real number.
A factor.
x v
Vector norm (vector length) squared. In quantum physics, it is probability of a quantum state.
⟨v|v⟩ FIXME: Feels it should be a getter
Creates a normalized vector (i.e. with norm 1).
A normalized vector: |v⟩ / √⟨v|v⟩
Outer product between two vectors. In this context, same as: Kronecker product and tensor product. https://en.wikipedia.org/wiki/Kronecker_product
Another operator.
v = v1 ⊗ v2
Changing order of dimensions for a vector, from [0, 1, 2, ...] to something else.
E.g. [2, 0, 1]
A normalized vector, from uniform distribution of U(n), restricted only to indices of vector, on a tensor component. Think of it as Vector.random optimized for partial inner products with the vector, on a selected subspace.
coordinates we want to keep
A normalized vector, from uniform distribution of U(n), restricted only to indices of vector. Think of it as Vector.random optimized for inner products with the vector.
Sort entires in-place (internal, important for diplay formats)
Change all dimensions with a given dimName to the desired basis.
'polarization', 'spin' or 'qubit'
basis
Export to a dense array format
Complex[] array vector
Groups some of vector coordinates. Mostly for intrnal use, e.g. partial inner product, Schmidt decomposition, etc.
Sorted indices of dimensions for vectors. Complementary ones are used for grouping.
Export entires into a flatten, sparse list.
E.g. [{i: 2, v: Cx(2, 4)}, {i: 5, v: Cx(-1, 0)}, ...]
Exports a form suitable for visualization, with fixed basis.
Minimal probability to emit an entry.
An array of elements like {amplitude: Cx(0.1, -0.5), coordStrings: ['3', 'H', 'V' '>', 'u']}
Generates a string for kets. See Vector.toString for formatting options.
.
Float precision.
A ket string, e.g. 0.71 exp(0.00τi) |3,1,>,V⟩ + 0.71 exp(1.00τi) |2,2,v,V⟩.
String description of a vector.
Complex number format - a choice between ["cartesian", "polar", "polarTau"].
Float display precision.
Entry separator.
If to show dimensions and sized.
A string, e.g.:
Vector with 3 entries of max size [2,2] with dimensions [spin,polarization] (0.00 +2.00i) |u,H⟩ + (-1.00 -1.00i) |d,H⟩ + (0.50 +2.50i) |d,V⟩
Generated using TypeDoc
Vector class. A complex number sparse vector aware of dimensions and tensor structure.
Complex and Dimension