Template Function Pennylane::Util::createProductState

Function Documentation

template<typename PrecisionT, typename ComplexT = std::complex<PrecisionT>>
auto Pennylane::Util::createProductState(std::string_view str) -> TestVector<ComplexT>

Create an arbitrary product state in X- or Z-basis.

Example: createProductState(“+01”) will produce |+01> state. Note that the wire index starts from the left.