API reference
tlquantum
: Quantum ML
Density Tensors
TensorLy-Quantum provides a convenient class for representing and manipulating density tensors:
|
A quantum state container for state and density matrix operations, including partial traces and quantum information metric calculations. |
Tensor-Trains
Also known as MPO, MPS, tensor-train is an efficient way to represent state-vectors and operators in factorized form. In TensorLy-Quantum, we provide out-of-the-box layers and circuits in the TT format.
Gates in TT-form
|
A unitary for all qubits in a TTCircuit, using tensor ring tensors with PyTorch Autograd support. |
|
Identity gate (does not change the state of the qubit on which it acts). |
|
Qubit rotations about the Y-axis with randomly initiated theta. |
|
Qubit rotations about the X-axis with randomly initiated theta. |
|
Qubit rotations about the Z-axis with randomly initiated theta. |
|
A Unitary sub-class that generates a layer of unitary, single-qubit rotations. |
|
A Unitary sub-class that generates a layer of a single two-qubit gates accross all qubits in a TTCircuit. |
|
Left (control-qubit) core of a CZ gate. |
|
Right (transformed qubit) core of a CZ gate. |
|
Left (control-qubit) core of a CNOT gate. |
|
Right (transformed qubit) core of a CNOT gate. |
|
Left or right core of the two-qubit SO4 rotations gate. |
|
Left and right core of the two-qubit O4 phase gate. |
We also provide some convenience functions to facilitate creation of some of the gates:
|
Pair of CZ class instances, one left (control) and one right (transformed). |
|
Pair of CNOT class instances, one left (control) and one right (transformed). |
|
Pair of SO4 two-qubit rotation class instances, with rotations over different states. |
Operators in TT-form
|
Generates tt-tensor unitary of one single-qubit operator per qubit. |
|
Generates tt-tensor classical Ising model Hamiltonian (two-qubit interaction terms in a single basis). |
|
Single-qubit identity opertor in the tt-tensor format. |
|
Single-qubit Pauli-X opertor in the tt-tensor format. |
|
Single-qubit Pauli-Y opertor in the tt-tensor format. |
|
Single-qubit Pauli-Z opertor in the tt-tensor format. |
States in TT-form
|
Generates tt-tensor state of computational basis product space described by spins. |
|
The norm of a TT-tensor state. |
Creating circuits
|
A simulator for variational quantum circuits using tensor ring tensors with PyTorch Autograd support. |
Adding TT/MPS/MPOs
|
Sums two TT tensors in decomposed form |
|
Sums two TT matrices in decomposed form |
Contracting Tensor Networks
|
Generates einsum contraciton equation. |
Precontraction
|
Contracts lists (layers) of tt-tensor cores horizontally (merging multiple cores in a single layer) up to some maximum number of qubits. |
|
Contracts sublists of a list of layers vertically (merging cores of multiple layers for a single qubit) up to some maximum contraction depth. |
Solving MaxCut
|
Calculates the MaxCut value of a given state (set of spins) for a given graph (weights). |
|
Brute force calculation of MaxCut for a given set of spins and weights. |