qrisp.mcz#

mcz(qubits, method='auto', ctrl_state=-1, num_ancilla=1)[source]#

Applies a multi-controlled Z gate.

For more information on the available methods, check the mcx documentation page.

Parameters:
qubitsQuantumVariable or list[Qubits]

The Qubits to control on.

methodstr, optional

The synthesis method. Available are auto, gray, gray_pt, gray_pt_inv, maslov, balauca, yong and hybrid. The default is auto.

ctrl_stateint or str, optional

The state on which to activate the Z gate. The default is “1111…”.

num_ancillaint, optional

Specifies the amount of ancilla qubits to use. This parameter is used only if the method is set to hybrid. The default is 1.