Template Function Pennylane::NanoBindings::applyControlledMatrix

Function Documentation

template<class StateT>
void Pennylane::NanoBindings::applyControlledMatrix(StateT &st, const nb::ndarray<const std::complex<typename StateT::PrecisionT>, nb::c_contig> &matrix, const std::vector<std::size_t> &controlled_wires, const std::vector<bool> &controlled_values, const std::vector<std::size_t> &wires, bool inverse = false)

Register controlled matrix kernel. Register the applyControlledMatrix function to the given state.

Template Parameters

StateT – The type of the state.

Parameters
  • st – The state to apply the matrix to.

  • matrix – The matrix to apply.

  • controlled_wires – The wires to apply the matrix to.

  • controlled_values – The values to apply the matrix to.