Skip to content

Conversation

@purva-thakre
Copy link
Contributor

@purva-thakre purva-thakre commented Nov 7, 2025

The Qrisp documentation provides a list of operations that can be added to an object of the QuantumCircuit class.

If the mcz, mcp or crz gates are added to a quantum circuit, we get AttributeError: 'QuantumCircuit' object has no attribute 'mcz'/'mcp'/'crz'. This PR adds the missing gates as methods of the QuantumCircuitclass.

from qrisp import QuantumCircuit
qc = QuantumCircuit(4)
qc.cx(0, range(1,4))
qc.mcz([0, 1], 3)
print(qc)

In the above code block, replace mcz with mcp or crz.

Edit: Spoke with Raphael on this. The gates that can be applied to the QuantumCircuit class are different from the gate functions on the linked page in the documentation. I don't know if it's worth adding these gates....

To do: mcrx exists in standard_operations.py but not as a method of the QuantumCircuit class.

@purva-thakre purva-thakre changed the title Add missing gates mcz, mcp and crz to QuantumCircuit Add mcz, mcp and crz to QuantumCircuit Nov 7, 2025
@purva-thakre purva-thakre marked this pull request as ready for review November 10, 2025 10:09
@purva-thakre purva-thakre marked this pull request as draft November 19, 2025 16:33
@positr0nium
Copy link
Contributor

Thanks for tackling this! To align the implementation of QuantumCircuit.mcp and QuantumCircuit.mcz more with the standalone functions mcp and mcz, I think it would be beneficial to remove the target argument 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants