Template Function Pennylane::Util::randomUnitary

Function Documentation

template<typename PrecisionT, class RandomEngine>
auto Pennylane::Util::randomUnitary(RandomEngine &re, std::size_t num_qubits) -> std::vector<std::complex<PrecisionT>>

Generate random unitary matrix.

Template Parameters
  • PrecisionT – Floating point type

  • RandomEngine – Random engine type

Parameters
  • re – Random engine instance

  • num_qubits – Number of qubits

Returns

Generated unitary matrix in row-major format