qrisp.mcp#

mcp(phi, qubits, method='auto', ctrl_state=-1)[source]#

Applies a multi-controlled phase gate.

The available methods are:

  • gray , which performs a traversal of the gray code.

  • balauca , which is a modified version of the algorithm presented here.

  • auto , which picks gray for any qubit count less than 4 and balauca otherwise.

Parameters:
phifloat or sympy.Symbol

The phase to apply.

qubitslist[Qubit] or QuantumVariable

The qubits to apply the multi-controlled phase gate on.

methodstr, optional

The method to deploy. The default is “auto”.

ctrl_statestr or int, optional

The control state on which to apply the phase. The default is “111…”.