Skip to content

Conversation

ajavadia
Copy link
Member

@ajavadia ajavadia commented Nov 17, 2021

an example that can be a use case for backendV2 and its compiler support.

ccx can be written as 2 cx and 3 csx (which is better than only if cx was available)

cx and csx can also be written as rzx(pi/2) and rzx(pi/4) respectively.

so in principle the basis translator should be able to rewrite ccx in terms of rzx(pi/2) and rzx(pi/4) if that's the instruction set that the backend has.

@ajavadia ajavadia requested a review from a team as a code owner November 17, 2021 05:14
@ajavadia
Copy link
Member Author

I hope there is a test that checks all additions to the standard equivalence library are correct

@ajavadia
Copy link
Member Author

I hope there is a test that checks all additions to the standard equivalence library are correct

yep, and it caught my off-by-global-phase error.

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks straightforwards, and the equivalences look right now in local testing.

I think we're ok without a changelog, unless we normally put one in for additional equivalences?

@ShellyGarion
Copy link
Member

ShellyGarion commented Nov 18, 2021

Are there any other equivalences in the equivalence library (or that we should add to it) that can be written more efficiently with a csx gate?

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1476434419

  • 15 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.0006%) to 82.541%

Files with Coverage Reduction New Missed Lines %
qiskit/pulse/library/waveform.py 3 90.38%
Totals Coverage Status
Change from base Build 1476251358: -0.0006%
Covered Lines: 49849
Relevant Lines: 60393

💛 - Coveralls

@ajavadia
Copy link
Member Author

I think we're ok without a changelog, unless we normally put one in for additional equivalences?

I think we are ok without one too.

Are there any other equivalences in the equivalence library (or that we should add to it) that can be written more efficiently with a csx gate?

This can be extended to multi-controlled toffolis, see pg 17 of barenco https://arxiv.org/pdf/quant-ph/9503016.pdf
Something to add as an enhancement. The XX decomposer is perhaps more useful for leveraging fractional gates, since it can be used to synthesize infinite operations. But it cannot act beyond 2-qubit gates, so I think both have their place.

@jakelishman jakelishman added automerge Changelog: None Do not include in changelog labels Nov 18, 2021
@jakelishman jakelishman added this to the 0.19 milestone Nov 18, 2021
@mergify mergify bot merged commit 6c0c8d2 into Qiskit:main Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants