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

🚸 Ancillary and garbage handling #167

Merged
merged 12 commits into from
Oct 20, 2022
Merged

🚸 Ancillary and garbage handling #167

merged 12 commits into from
Oct 20, 2022

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Oct 18, 2022

Description

This PR ensures that the way ancillary and garbage qubits are treated in QCEC is theoretically sound and removes several corresponding "TODOs" in the code.

In particular, the alternating DD checker cannot be used whenever both circuits contain ancillary qubits that are acted upon.
Up until now, this did not cause any issues since, for the predominant use case of verifying compilation results, only one of the circuits typically uses ancillary qubits.
As a solution, the default verification scheme switches to the construction checker whenever it detects that the alternating checker is not capable of handling the circuits in question.
Furthermore, the alternating checker emits an exception should it ever be configured to still run on instances it can't handle.

Last, but not least, the matrix equivalence check is slightly improved so that it does not incur an inversion and a multiplication when ancillaries are used.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

burgholzer and others added 8 commits October 3, 2022 14:27
Signed-off-by: burgholzer <burgholzer@me.com>
…ting checker

Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: Lukas Burgholzer <lukas.burgholzer@jku.at>
Signed-off-by: Lukas Burgholzer <lukas.burgholzer@jku.at>
@burgholzer burgholzer added feature New feature or request usability Anything related to usability c++ Anything related to C++ code labels Oct 18, 2022
@burgholzer burgholzer requested a review from pehamTom October 18, 2022 19:36
@burgholzer burgholzer self-assigned this Oct 18, 2022
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Merging #167 (cc4abee) into main (7ea1567) will decrease coverage by 0.0%.
The diff coverage is 97.6%.

@@           Coverage Diff           @@
##            main    #167     +/-   ##
=======================================
- Coverage   98.0%   98.0%   -0.1%     
=======================================
  Files         35      35             
  Lines       1716    1736     +20     
  Branches     205     204      -1     
=======================================
+ Hits        1683    1702     +19     
- Misses        33      34      +1     
Flag Coverage Δ
cpp 98.1% <97.6%> (-0.1%) ⬇️
python 96.8% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/checker/dd/DDAlternatingChecker.hpp 93.3% <ø> (ø)
src/checker/dd/DDAlternatingChecker.cpp 97.2% <94.1%> (-1.5%) ⬇️
src/EquivalenceCheckingManager.cpp 97.9% <100.0%> (+<0.1%) ⬆️
src/checker/dd/DDEquivalenceChecker.cpp 96.1% <100.0%> (ø)
test/test_equality.cpp 100.0% <100.0%> (ø)
include/EquivalenceCheckingManager.hpp 100.0% <0.0%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Lukas Burgholzer <lukas.burgholzer@jku.at>
Copy link
Member

@pehamTom pehamTom left a comment

Choose a reason for hiding this comment

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

Nice that this PR finally handles the long-standing question of ancillaries.

I didn't find anything major, just a discussion and a minor remark. Other than that, LGTM.

src/EquivalenceCheckingManager.cpp Show resolved Hide resolved
src/checker/dd/DDAlternatingChecker.cpp Show resolved Hide resolved
@burgholzer burgholzer merged commit 4f0d0b2 into main Oct 20, 2022
@burgholzer burgholzer deleted the ancillary-and-garbage branch October 20, 2022 11:09
MarlQ pushed a commit to MarlQ/qcec that referenced this pull request Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code feature New feature or request usability Anything related to usability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants