Template Class MPSTNCuda

Inheritance Relationships

Base Type

  • public Pennylane::LightningTensor::TNCuda::TNCuda< Precision, MPSTNCuda< Precision > > (Template Class TNCuda)

Class Documentation

template<class Precision>
class MPSTNCuda : public Pennylane::LightningTensor::TNCuda::TNCuda<Precision, MPSTNCuda<Precision>>

Managed memory MPS class using cutensornet high-level APIs backed.

Template Parameters

Precision – Floating-point precision type.

Public Types

using CFP_t = decltype(cuUtil::getCudaType(Precision{}))
using ComplexT = std::complex<Precision>
using PrecisionT = Precision

Public Functions

MPSTNCuda() = delete
inline explicit MPSTNCuda(const std::size_t numQubits, const std::size_t maxBondDim)
inline explicit MPSTNCuda(const std::size_t numQubits, const std::size_t maxBondDim, DevTag<int> dev_tag)
~MPSTNCuda() = default
inline auto getMaxBondDim() const -> std::size_t

Get the max bond dimension.

Returns

std::size_t

inline auto getBondDims(std::size_t idx) const -> std::size_t

Get the bond dimensions.

Returns

std::vector<std::size_t>

inline void applyMPOOperation(const std::vector<std::vector<ComplexT>> &tensors, const std::vector<std::size_t> &wires, const std::size_t max_mpo_bond_dim)

Apply an MPO operator with the gate’s MPO decomposition data provided by the user to the compute graph.

This API only works for the MPS backend.

Parameters
  • tensors – The MPO representation of a gate. Each element in the outer vector represents a MPO tensor site.

  • wires – The wire indices of the gate acts on. The size of this vector should match the size of the tensors vector.

  • max_mpo_bond_dim – The maximum bond dimension of the MPO operator.

inline void append_mps_final_state(double cutoff = 0, std::string cutoff_mode = "abs")

Append MPS final state to the quantum circuit.

Parameters
  • cutoff – Cutoff value for SVD decomposition. Default is 0.

  • cutoff_mode – Cutoff mode for SVD decomposition. Default is “abs”.

Public Static Attributes

static constexpr auto method = "mps"