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

Support Qiskit 1.x #162

Merged
merged 9 commits into from
Mar 5, 2024
Merged

Support Qiskit 1.x #162

merged 9 commits into from
Mar 5, 2024

Conversation

speller26
Copy link
Collaborator

Summary

Removes qiskit<1.0 restriction and updates tests to use 1.x-compatible components.

Details and comments

@speller26 speller26 linked an issue Mar 4, 2024 that may be closed by this pull request
@jcjaskula-aws
Copy link
Collaborator

LGTM at first pass. While I have a more thorough look in the coming days, can you ensure me that the notebooks run well top to bottom?

@speller26
Copy link
Collaborator Author

Tests are failing due to incorrect implementation of MS gate in qiskit-ionq: qiskit-community/qiskit-ionq#162. Will be fixed by qiskit-community/qiskit-ionq#174.

Copy link
Collaborator

@jcjaskula-aws jcjaskula-aws left a comment

Choose a reason for hiding this comment

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

Minor comments. I'll be fine if you decide to stick with your current implementation.

qiskit>=0.34.2, <1.0
qiskit-ionq>=0.4.7
qiskit>=0.34.2
# TODO: update to new minimum version >0.5.0 once
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we write somewhere if there is anything we expect to change in our code when we switch to 0.5.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's also a TODO in the relevant code:

# TODO: use compare_braket_qiskit_unitaries once
# MS gate implementation in qiskit-ionq has been corrected
np.allclose(
to_braket(qiskit_circuit).to_unitary(),
Operator(qiskit_circuit).to_matrix(),
)

@@ -91,6 +88,14 @@
]


def compare_braket_qiskit_unitaries(qiskit_circuit: QuantumCircuit) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: if it is useful somewhere else, we could have compare_braket_qiskit_unitaries(braket_circuit, qiskit_circuit) and call compare_braket_qiskit_unitaries(to_braket(qiskit_circuit), qiskit_circuit)) below.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We could also consider calling it compare_unitaries.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That could be useful, but the point of this method is to check whether the converted circuit has the correct matrix; I'll rename the function accordingly.

@speller26 speller26 merged commit ca628fe into main Mar 5, 2024
7 checks passed
@speller26 speller26 deleted the qiskit-1.x branch March 5, 2024 21:52
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.

Upgrade requirements to allow qiskit~=1.0.0
2 participants