Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Implement Multi-Controlled X Gate in ProjectQ Like Qiskit's qc.mcx([0, 1, 3], 2)? #478

Open
saifawan2703 opened this issue Oct 17, 2024 · 1 comment

Comments

@saifawan2703
Copy link

Hello ProjectQ Community,

I am transitioning from Qiskit to ProjectQ and I’m trying to replicate a specific operation. In Qiskit, I can use the following code to apply a multi-controlled X gate:
qc.mcx([0, 1, 3], 2)
I would like to know how to achieve the same functionality in ProjectQ. Is there a built-in function for multi-controlled X gates, or do I need to implement it manually? If manual implementation is required, could someone provide an example?

Thank you for your help!

@damiansteiger
Copy link
Contributor

You can achieve this with a ControlledGate or C(), see
https://projectq.readthedocs.io/en/latest/_doc_gen/projectq.ops.html#projectq.ops.ControlledGate

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

No branches or pull requests

2 participants