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

PrimitivesV2 schemas #14

Merged
merged 51 commits into from
May 21, 2024
Merged

PrimitivesV2 schemas #14

merged 51 commits into from
May 21, 2024

Conversation

gadial
Copy link
Contributor

@gadial gadial commented Feb 28, 2024

Summary

This PR adds schemas for input for V2 primitives (EstimatorV2/SamplerV2) which rely on qiskit.primitives.containers for data passing.

Addresses #121

schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
schemas/estimator_v2_schema.json Show resolved Hide resolved
schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
}
}
},
"resilience_level": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

resilience_level is not inside options

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

schemas/estimator_v2_schema.json Show resolved Hide resolved
schemas/sampler_v2_schema.json Outdated Show resolved Hide resolved
schemas/sampler_v2_schema.json Show resolved Hide resolved
Copy link
Collaborator

@jyu00 jyu00 left a comment

Choose a reason for hiding this comment

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

Can you also add support_qiskit? Just so we don't have to make that update later.

Note that we should make the schema as descriptive as possible, since we got a lot of questions on using the REST API.

"minItems": 2,
"prefixItems": [
{"description": "The quantum circuit in base64-encoded QPY format. See https://docs.quantum.ibm.com/api/qiskit/qpy for more details on QPY.", "type": "object"},
{"description": "One or more observables.", "type": "array"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

It'd be helpful to point out the array elements need to be strings and/or show an example in the description.

schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
schemas/estimator_v2_schema.json Show resolved Hide resolved
schemas/sampler_v2_schema.json Outdated Show resolved Hide resolved
schemas/estimator_v2_schema.json Outdated Show resolved Hide resolved
schemas/sampler_v2_schema.json Outdated Show resolved Hide resolved
schemas/sampler_v2_schema.json Show resolved Hide resolved
@jyu00
Copy link
Collaborator

jyu00 commented Apr 2, 2024

@gadial Can you also add some tests?

gadial and others added 18 commits April 3, 2024 09:28
@gadial gadial requested a review from jyu00 April 28, 2024 12:59
"type": "array",
"minItems": 1,
"prefixItems": [
{"description": "The quantum circuit in QASM string or base64-encoded QPY format. See https://docs.quantum.ibm.com/api/qiskit/qpy for more details on QPY.", "type": "object"},
Copy link

Choose a reason for hiding this comment

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

I think this type should be an object or a string (for the qasm string case)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in b9f86871958419765806ec4e41c2810d75351fc5

@@ -2,3 +2,4 @@ fastjsonschema
jsonschema
jsonschema-rs
ddt
qiskit-ibm-runtime@git+https://[email protected]/Qiskit/qiskit-ibm-runtime.git
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason we want to install from main branch and not just the latest release?

Copy link
Contributor Author

@gadial gadial May 21, 2024

Choose a reason for hiding this comment

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

Originally it was qiskit-ibm-runtime>=0.22 but I changed it because we had test failures due to obsolete code. I tried switching to 0.23 and had a similar problem now. That's because of small errors in qiskit-ibm-runtime which I already fixed (e.g. it considered value of 0 for a pec-option as boolean False and so did not check whether the enable-pec option is True. Really minor stuff.

schemas/sampler_v2_schema.json Show resolved Hide resolved
schemas/sampler_v2_schema.json Show resolved Hide resolved
@jyu00 jyu00 merged commit db62121 into Qiskit:main May 21, 2024
3 checks passed
@gadial gadial deleted the primitives_schemas branch May 22, 2024 05:58
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