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

No wireswap handling in the creation of a phase poly box #126

Closed
cqc-melf opened this issue Nov 18, 2021 · 0 comments
Closed

No wireswap handling in the creation of a phase poly box #126

cqc-melf opened this issue Nov 18, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@cqc-melf
Copy link
Contributor

Wireswaps are not handled in the creation of a phase poly box, this should be changed.

Circuit circ(2);
circ.add_op<unsigned>(OpType::SWAP, {0, 1});
circ.replace_SWAPs();
std::cout << "has wireswaps: " << circ.has_implicit_wireswaps()
          << std::endl;
PhasePolyBox ppbox(circ);
std::shared_ptr<Circuit> circptr = ppbox.to_circuit();
Circuit circ2 = *circptr;
for (auto c : circ2) {
  c.print();
}
std::cout << "has wireswaps: " << circ2.has_implicit_wireswaps()
          << std::endl;
REQUIRE(test_unitary_comparison(circ, circ2));

Will fail with:

Begin testcase: single SWAP circuit in PhasePolyBox
has wireswaps: 1
has wireswaps: 0

test_tket is a Catch v2.13.7 host application.
Run with -? for options

FAILED:
  REQUIRE( test_unitary_comparison(circ, circ2) )
with expansion:
  false
@cqc-melf cqc-melf added the bug Something isn't working label Nov 18, 2021
cqc-melf added a commit that referenced this issue Jan 4, 2022
#146)

Fixes: [TKET-1653] No wireswap handling in the creation of a phase poly box #126

* add bugfix for wireswap in ppb creation

* try to fix mac

* try to fix mac II
@cqc-melf cqc-melf closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant