Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Handle parameterized circuits #586

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

mtreinish
Copy link
Member

Summary

After Qiskit/qiskit#3383 the conversion of types outside the
standard set of types understood by the standard json encoder is the
responsibility of the ibmq provider. However, there was one type missing
from the custom encoder class added to handle this, ParameterExpression.
For bound parameterized circuit the ParameterExpression class will be
castable to a float to get the bound numeric value that should be sent
on the wire with the job. However, the encoder doesn't have handling for
this. Qiskit/qiskit#3959 is adding conversion for the to_dict()
qobj method so that floats are output, but this a stop gap workaround
while a better solution is being developed. We should have handling
in qiskit-ibmq-provider if/when ParameterExpression objects get passed
in via qobj object.

Details and comments

After Qiskit/qiskit#3383 the conversion of types outside the
standard set of types understood by the standard json encoder is the
responsibility of the ibmq provider. However, there was one type missing
from the custom encoder class added to handle this, ParameterExpression.
For bound parameterized circuit the ParameterExpression class will be
castable to a float to get the bound numeric value that should be sent
on the wire with the job. However, the encoder doesn't have handling for
this. Qiskit/qiskit#3959 is adding conversion for the to_dict()
qobj method so that floats are output, but this a stop gap workaround
while a better solution is being developed. We should have handling
in qiskit-ibmq-provider if/when ParameterExpression objects get passed
in via qobj object.
@mtreinish mtreinish changed the title Handled parameterized circuits Handle parameterized circuits Mar 12, 2020
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.

LGTM

@jyu00 jyu00 merged commit 2c4d04d into Qiskit:master Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants