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

Convert braket circuits to qiskit circuits #136

Merged

Conversation

jcjaskula-aws
Copy link
Collaborator

@jcjaskula-aws jcjaskula-aws commented Jan 2, 2024

Summary

Implemented a to_qiskit method to convert Braket Circuits to Qiskit QuantumCircuits.

Details and comments

We keep track of the free parameter names to reuse them if they appear several times in the circuits. Because the dicts construct parametric gates with a standalone Parameter, one needs to extra the class object to recreate a new gate with the right circuit Parameters.
We add a measure_all instruction at the end because Braket measure all qubits.

  • non-parametric gates
  • parametric gates
  • gates with modifiers
  • (deferred to another PR) result types

@jcjaskula-aws jcjaskula-aws marked this pull request as ready for review January 20, 2024 18:07
@jcjaskula-aws jcjaskula-aws marked this pull request as draft January 20, 2024 18:15
@jcjaskula-aws jcjaskula-aws marked this pull request as ready for review January 20, 2024 20:44
qiskit_braket_provider/providers/adapter.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Show resolved Hide resolved
tests/providers/test_adapter.py Show resolved Hide resolved
tests/providers/test_adapter.py Outdated Show resolved Hide resolved
tests/providers/test_adapter.py Show resolved Hide resolved
tests/providers/test_adapter.py Show resolved Hide resolved
tests/providers/test_adapter.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@laurencap laurencap left a comment

Choose a reason for hiding this comment

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

LGTM!

@speller26 speller26 merged commit 5c1cce0 into qiskit-community:main Feb 5, 2024
7 checks passed
@jcjaskula-aws jcjaskula-aws deleted the jcjaskula-aws/from_braket branch February 5, 2024 16:45
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