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

Remove marshmallow #553

Closed
6 tasks done
jyu00 opened this issue Feb 19, 2020 · 2 comments
Closed
6 tasks done

Remove marshmallow #553

jyu00 opened this issue Feb 19, 2020 · 2 comments
Assignees
Labels

Comments

@jyu00
Copy link
Collaborator

jyu00 commented Feb 19, 2020

What is the expected behavior?

qiskit-terra is moving away from marshmallow due to performance. The provider will need to stop using terra's marshmallow schemas as well as removing its own, since it relies on terra's methods and for consistency.

This needs to be in sync with Qiskit/qiskit#3383 which removes schemas like QobjSchema used by the provider.

Tasks:

  • Remove marshmallow from ibmq-provider
  • Custom encoder to convert objects to JSON serializable
  • Custom decoder to convert
    • list back to complex
    • string back to datetime
  • Test cases to verify en/decoder
@mtreinish
Copy link
Member

I started this in: #555

mtreinish added a commit to mtreinish/qiskit-ibmq-provider that referenced this issue Feb 19, 2020
The qobj payload has a couple of quirks related to how qobj objects can
be constructed (and will be constructed after Qiskit/qiskit#3383
merges) that aren't handled by the default json encoder. The first is
that complex numbers are converted to the form "(real, imaginary)", and
the second is that numpy arrays are sometimes part of the payload.
Instead of relying on a layer outside of the provider coercing these
objects to the expected format this commit changes how we push qobj
payloads to the iqx api so that we run it through a json encoder that
understands how to do this. After this commit qiskit-ibmq-provider owns
it's own payload format and the generation of the expected json payload
format instead of relying on an external library to handle it for us.

Related to Qiskit#553
mtreinish added a commit to mtreinish/qiskit-ibmq-provider that referenced this issue Feb 19, 2020
The qobj payload has a couple of quirks related to how qobj objects can
be constructed (and will be constructed after Qiskit/qiskit#3383
merges) that aren't handled by the default json encoder. The first is
that complex numbers are converted to the form "(real, imaginary)", and
the second is that numpy arrays are sometimes part of the payload.
Instead of relying on a layer outside of the provider coercing these
objects to the expected format this commit changes how we push qobj
payloads to the iqx api so that we run it through a json encoder that
understands how to do this. After this commit qiskit-ibmq-provider owns
it's own payload format and the generation of the expected json payload
format instead of relying on an external library to handle it for us.

Related to Qiskit#553
mtreinish added a commit to mtreinish/qiskit-ibmq-provider that referenced this issue Feb 19, 2020
The qobj payload has a couple of quirks related to how qobj objects can
be constructed (and will be constructed after Qiskit/qiskit#3383
merges) that aren't handled by the default json encoder. The first is
that complex numbers are converted to the form "(real, imaginary)", and
the second is that numpy arrays are sometimes part of the payload.
Instead of relying on a layer outside of the provider coercing these
objects to the expected format this commit changes how we push qobj
payloads to the iqx api so that we run it through a json encoder that
understands how to do this. After this commit qiskit-ibmq-provider owns
it's own payload format and the generation of the expected json payload
format instead of relying on an external library to handle it for us.

Related to Qiskit#553
jyu00 added a commit that referenced this issue Feb 21, 2020
The qobj payload has a couple of quirks related to how qobj objects can
be constructed (and will be constructed after Qiskit/qiskit#3383
merges) that aren't handled by the default json encoder. The first is
that complex numbers are converted to the form "(real, imaginary)", and
the second is that numpy arrays are sometimes part of the payload.
Instead of relying on a layer outside of the provider coercing these
objects to the expected format this commit changes how we push qobj
payloads to the iqx api so that we run it through a json encoder that
understands how to do this. After this commit qiskit-ibmq-provider owns
it's own payload format and the generation of the expected json payload
format instead of relying on an external library to handle it for us.

Related to #553

Co-authored-by: Jessie Yu <[email protected]>
@jyu00 jyu00 self-assigned this Mar 16, 2020
@jyu00
Copy link
Collaborator Author

jyu00 commented Apr 15, 2020

One thing to note is that for complex numbers, marshmallow used to convert them from list to complex when a from_dict() is done. This now needs to be done in the provider when it deserializes the data from the server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants