Template Class TwoQubitGateWithParamHelper

Class Documentation

template<class AVXImpl, class ParamT>
class TwoQubitGateWithParamHelper

A helper class for two-qubit gate without parameters.

Public Types

using Precision = typename AVXImpl::Precision
using ReturnType = typename FuncReturn<decltype(AVXImpl::template applyExternalExternal<Precision>)>::Type
using FuncType = ReturnType (*)(std::complex<Precision>*, size_t, const std::vector<size_t>&, bool, ParamT)

Public Functions

inline explicit TwoQubitGateWithParamHelper(FuncType fallback_func)
inline auto operator()(std::complex<Precision> *arr, const size_t num_qubits, const std::vector<size_t> &wires, bool inverse, ParamT angle) const -> ReturnType
requires SymmetricTwoQubitGateWithParam<AVXImpl>

A specialization for symmetric two-qubit gates (control and target wires are symmetric), which calls the correct AVX2/512 kernel functions based on wires.

Parameters
  • arr – Pointer to a statevector array

  • num_qubits – Number of qubits

  • wires – Wires the gate applies to

  • inverse – Apply the inverse of the gate when true

  • angle – Parameter of the gate

inline auto operator()(std::complex<Precision> *arr, const size_t num_qubits, const std::vector<size_t> &wires, bool inverse, ParamT angle) const -> ReturnType
requires AsymmetricTwoQubitGateWithParam<AVXImpl>

A specialization for asymmetric two-qubit gates (control and target wires are asymmetric), which calls the correct AVX2/512 kernel functions based on wires.

Parameters
  • arr – Pointer to a statevector array

  • num_qubits – Number of qubits

  • wires – Wires the gate applies to

  • inverse – Apply the inverse of the gate when true

  • angle – Parameter of the gate

Public Static Attributes

static constexpr size_t packed_size = AVXImpl::packed_size_