Template Class StateVectorLQubitRaw¶
Defined in File StateVectorLQubitRaw.hpp
Inheritance Relationships¶
Base Type¶
public Pennylane::LightningQubit::StateVectorLQubit< double, StateVectorLQubitRaw< double > >
(Template Class StateVectorLQubit)
Class Documentation¶
-
template<class fp_t = double>
class StateVectorLQubitRaw : public Pennylane::LightningQubit::StateVectorLQubit<double, StateVectorLQubitRaw<double>>¶ State-vector operations class.
This class binds to a given statevector data array, and defines all operations to manipulate the statevector data for quantum circuit simulation. We define gates as methods to allow direct manipulation of the bound data, as well as through a string-based function dispatch. The bound data is assumed to be complex, and is required to be in either 32-bit (64-bit
complex<float>
) or 64-bit (128-bitcomplex<double>
) floating point representation.- Template Parameters
fp_t – Floating point precision of underlying statevector data.
Public Types
-
using ComplexT = std::complex<PrecisionT>¶
Public Functions
-
inline StateVectorLQubitRaw(ComplexT *data, std::size_t length, Threading threading = Threading::SingleThread)¶
Construct state-vector from a raw data pointer.
Memory model is automatically deduced from a pointer.
- Parameters
data – Raw data pointer.
length – The size of the data, i.e. 2^(number of qubits).
threading – Threading option the statevector to use
-
inline auto getData() const -> ComplexT*¶
Get the underlying data pointer.
- Returns
const ComplexT* Pointer to statevector data.
-
inline auto getData() -> ComplexT*¶
Get the underlying data pointer.
- Returns
ComplexT* Pointer to statevector data.
-
inline auto getDataVector() -> std::vector<ComplexT>¶
Get a copy of underlying data.
- Returns
a std::vector<ComplexT> object that stores statevector data.
-
inline auto getLength() const -> std::size_t¶
Get the number of data elements in the statevector array.
- Returns
std::size_t