qiskit.ml.circuit.library.RawFeatureVector.power¶
-
RawFeatureVector.
power
(power, matrix_power=False)¶ Raise this circuit to the power of
power
.If
power
is a positive integer andmatrix_power
isFalse
, this implementation defaults to callingrepeat
. Otherwise, if the circuit is unitary, the matrix is computed to calculate the matrix power.- Parameters
power (int) – The power to raise this circuit to.
matrix_power (bool) – If True, the circuit is converted to a matrix and then the matrix power is computed. If False, and
power
is a positive integer, the implementation defaults torepeat
.
- Raises
CircuitError – If the circuit needs to be converted to a gate but it is not unitary.
- Returns
A circuit implementing this circuit raised to the power of
power
.- Return type