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

Toffoli gates as elementary gates #70

Open
AbhiDu96 opened this issue Apr 15, 2024 · 5 comments
Open

Toffoli gates as elementary gates #70

AbhiDu96 opened this issue Apr 15, 2024 · 5 comments

Comments

@AbhiDu96
Copy link

Can Toffoli gates be included as elementary gates to synthesize 4 and 5 multi-controlled unitary gates? I am thinking of something similar to what you have currently, i.e., "CNOT_1_2" and "CV_1_2". So something like "Tof_1_2_3" and "Too_1_3_2" where the first two indices denote the control qubits and the last qubit denotes the target qubit.

Thanks

@harshangrjn
Copy link
Owner

@AbhiDu96, not at this point. Though, that would be a valuable addition to the package. Would you like to do a PR for including 3 qubit Toffoli gates? Currently, global phase gates are the only multi-qubit gates supported.

@AbhiDu96
Copy link
Author

Hi @harshangrjn , thanks a lot for the quick response. I would be happy to do a PR for the 3-qubit Toffoli gate. It would certainly help a lot with my own project.

@harshangrjn
Copy link
Owner

Thanks! Once you make a working PR, I shall add the necessary unit tests and other mods to make it compatible.

@harshangrjn
Copy link
Owner

@AbhiDu96 In PR #71 , multi_controlled_gate in src/utility.jl now addresses the support for multi-controlled gates with any single-q target gate. For a multi-control Toffoli 3-q Toffoli, its

QCOpt.multi_controlled_gate(QCOpt.XGate(), [1,2], 3, 3)

Yet to make the bridge to be able to support these gates as elementary_gates. Let me know if you have any suggestions/thoughts.

@AbhiDu96
Copy link
Author

AbhiDu96 commented May 24, 2024

Hi @harshangrjn the modified code looks good. I tried it out, and it works. You can add it as an elementary gate.

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