Operator.power

Operator.power(n)[source]

Return the matrix power of the operator.

Parameters

n (int) – the power to raise the matrix to.

Returns

the n-times composed operator.

Return type

BaseOperator

Raises

QiskitError – if the input and output dimensions of the operator are not equal, or the power is not a positive integer.