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

Approximate Quantum Compiler #6727

Merged
merged 130 commits into from
Nov 23, 2021
Merged

Approximate Quantum Compiler #6727

merged 130 commits into from
Nov 23, 2021

Conversation

adekusar-drl
Copy link
Contributor

@adekusar-drl adekusar-drl commented Jul 12, 2021

Summary

This is an implementation of Approximate Quantum Compiler from the paper "Best Approximate Quantum Compiling Problems", https://arxiv.org/abs/2106.05649. The implementation is a minimal version and does not include all features from the referenced paper.

Details and comments

The implementation includes:

Authors:

  • Liam Madden
  • Andrea Simonetto
  • Albert Akhriev

@adekusar-drl
Copy link
Contributor Author

In testing, I came across the following error, but it's not clear to me where it originates:

@kdk All works on my laptop and I get an identity matrix in the end. I don't know what caused this error, unfortunately. I added a test case with this snippet, this case is closer to the actual workflow of the transpiler.

@adekusar-drl adekusar-drl requested a review from kdk October 26, 2021 21:24
@1ucian0
Copy link
Member

1ucian0 commented Oct 27, 2021

In testing, I came across the following error, ...

As @adekusar-drl , I also was unable to reproduce this issue.

@kdk
Copy link
Member

kdk commented Nov 1, 2021

In testing, I came across the following error, ...

As @adekusar-drl , I also was unable to reproduce this issue.

Upgrading to scipy 1.5 resolved this for me. Can you check if this is compatible with scipy 1.4 and update the requirements.txt if not?

@adekusar-drl
Copy link
Contributor Author

adekusar-drl commented Nov 2, 2021

@kdk I can confirm there are issues with scpi 1.4. I have another error, not the same as you had. Despite it is a deprecation, the tests fail. So, I think it is safer to upgrade the requirements. Please take a look and thanks for spotting this issue.

Error
testtools.testresult.real._StringException: Traceback (most recent call last):
  File ".../qiskit-terra/test/python/transpiler/aqc/test_aqc.py", line 56, in test_aqc
    initial_point=np.array(INITIAL_THETAS),
  File ".../qiskit-terra/qiskit/transpiler/synthesis/aqc/aqc.py", line 99, in compile_unitary
    jac=approximating_objective.gradient,
  File ".../qiskit-terra/qiskit/algorithms/optimizers/scipy_optimizer.py", line 136, in minimize
    **self._kwargs,
  File ".../envs/dev-terra/lib/site-packages/scipy/optimize/_minimize.py", line 610, in minimize
    callback=callback, **options)
  File ".../envs/dev-terra/lib/site-packages/scipy/optimize/lbfgsb.py", line 339, in _minimize_lbfgsb
    task_str = task.tostring()
DeprecationWarning: tostring() is deprecated. Use tobytes() instead.

@coveralls
Copy link

coveralls commented Nov 6, 2021

Pull Request Test Coverage Report for Build 1494293906

  • 410 of 428 (95.79%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 82.761%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/synthesis/aqc/cnot_unit_objective.py 131 132 99.24%
qiskit/transpiler/synthesis/aqc/elementary_operations.py 15 16 93.75%
qiskit/transpiler/synthesis/aqc/cnot_unit_circuit.py 40 42 95.24%
qiskit/transpiler/synthesis/aqc/approximate.py 28 34 82.35%
qiskit/transpiler/synthesis/aqc/cnot_structures.py 106 114 92.98%
Totals Coverage Status
Change from base Build 1490628111: 0.09%
Covered Lines: 50173
Relevant Lines: 60624

💛 - Coveralls

@adekusar-drl
Copy link
Contributor Author

@kdk recent changes include:

@adekusar-drl
Copy link
Contributor Author

Hi @kdk are there any news on the PR?

Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

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

Thanks for the updates! This LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog synthesis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants