tlquantum.tt_contraction
.contraction_eq
- tlquantum.tt_contraction.contraction_eq(nqubits, nlayers, kept_inds=None, to_ket=False, to_operator=False)[source]
Generates einsum contraciton equation.
- Parameters:
- nqubitsint, number of qubits to contract over
- nlayersint, number of layers to contract over
- kept_indslist of inds, qubit indices to keep. If not None, then ptrace equation is generated
- Returns:
- string of the contraction equation.