Skip to content

Import the multi-controlled Gates from Terra, not Aqua#3886

Merged
Cryoris merged 2 commits into
Qiskit:masterfrom
Cryoris:import-multi-controlled-gates-from-terra
Feb 26, 2020
Merged

Import the multi-controlled Gates from Terra, not Aqua#3886
Cryoris merged 2 commits into
Qiskit:masterfrom
Cryoris:import-multi-controlled-gates-from-terra

Conversation

@Cryoris
Copy link
Copy Markdown
Collaborator

@Cryoris Cryoris commented Feb 25, 2020

Summary

Several multi-controlled gates (see below) have been copied to Terra, but are not included in any __init__ and therefore only imported through Aqua, where they are included in an __init__ file.
If they already exist in Terra we should also include them from there, so we can finally remove these duplicate gate implementations from Aqua.

Two files remain in Aqua, namely the multi-control multi-target Toffoli and some boolean logic gates. Is there a reason why only part of the gates have been moved here?

Details and comments

This affects:

multi_controlled_u1_gate -> mcu1
multi_controlled_toffoli_gate -> mct
multi_controlled_rotation_gates -> mcrx, mcry, mcrz

These gates exist in Aqua: https://github.com/Qiskit/qiskit-aqua/tree/master/qiskit/aqua/circuits/gates
The three files named above also co-exist in Terra.

@ewinston
Copy link
Copy Markdown
Contributor

Hi Julien, can these gates be made to behave like other gates in extensions/standard? I would expect them to inherit from ControlledGate.

@Cryoris
Copy link
Copy Markdown
Collaborator Author

Cryoris commented Feb 25, 2020

Yes, these are ongoing projects, as e.g. for the multi-controlled U1 (#3883) or the relative-phase Toffolis (#3761). But this PR is to not have dead code in Terra that's not imported. Also, if we import them here we can remove them from Aqua at once.

@ewinston
Copy link
Copy Markdown
Contributor

Ok, this seems fine then. Are you also submitting a similar pr for the multi controlled rotation gates?

@Cryoris
Copy link
Copy Markdown
Collaborator Author

Cryoris commented Feb 25, 2020 via email

@Cryoris Cryoris merged commit 7e19692 into Qiskit:master Feb 26, 2020
@Cryoris Cryoris deleted the import-multi-controlled-gates-from-terra branch February 26, 2020 09:04
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
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.

3 participants