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

Fix QASM examples #1993

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Fix QASM examples #1993

wants to merge 9 commits into from

Conversation

beckykd
Copy link
Collaborator

@beckykd beckykd commented Sep 19, 2024

Fixes #1984

Copy link

@f5sfu f5sfu left a comment

Choose a reason for hiding this comment

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

hi,
as some libs are not useful for the example, I would replace

from qiskit import transpile, assemble, qasm3
from qiskit.converters import circuit_to_dag, dag_to_circuit
from qiskit.quantum_info import Statevector

by only
from qiskit import transpile

I would also add the backend stuff before the parameter definition

backend = service.backend("your selected backend")
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
pm = generate_preset_pass_manager(backend=backend, optimization_level=1)

Thanks

@qiskit-bot
Copy link
Contributor

One or more of the following people are relevant to this code:

Copy link

@f5sfu f5sfu 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 these improvements

Copy link
Contributor

@acastellane acastellane left a comment

Choose a reason for hiding this comment

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

Looks good to me, Thanks

docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Show resolved Hide resolved
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Might be worth having Abby C copy edit

headers = {
'Content-Type': 'application/json',
'"Authorization": f"Bearer xxxxxxx",
'x-qx-client-application': 'qiskit-version-2/0.39.2/'+'your_application' # specifying the application you might be running from. For an actual Integration project, this option is invaluable to know where jobs are coming from. At this time the "qiskit-version-2/0.39.2/" string is a necessary prefix.
Copy link
Collaborator

@Eric-Arellano Eric-Arellano Sep 27, 2024

Choose a reason for hiding this comment

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

Can you please double check with the SMEs qiskit-version-2/0.39.2 is still accurate - I'm surprised it's set to 0.39.2?

Suggested change
'x-qx-client-application': 'qiskit-version-2/0.39.2/'+'your_application' # specifying the application you might be running from. For an actual Integration project, this option is invaluable to know where jobs are coming from. At this time the "qiskit-version-2/0.39.2/" string is a necessary prefix.
# You should replace <your_application> with the name of your app. This is useful to know
# where jobs are coming from. Note that the prefix "qiskit-version-2/0.39.2/" is necessary.
'x-qx-client-application': f'qiskit-version-2/0.39.2/<your_application>',

Copy link
Collaborator

Choose a reason for hiding this comment

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

I still suggest my change to use an f string and put the comment above the line, split over two lines

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep - I wasn't ignoring that comment; I was just leaving it open because I'm still looking for a good answer from an SME.

docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
docs/guides/primitives-rest-api.mdx Outdated Show resolved Hide resolved
Copy link
Collaborator

@abbycross abbycross left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Fix QASM examples
6 participants