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 qpy custom ControlledGate with overloaded _define() (backport #8927) #8937

Merged
merged 2 commits into from
Oct 18, 2022

Commits on Oct 18, 2022

  1. Fix qpy custom ControlledGate with overloaded _define() (#8927)

    This commit fixes a bug in the QPY serialization of ControlledGate
    subclasses that defined custom _define() methods. The _define() method
    is the typical way to provide a custom definition in Gate classes. While
    ControlledGate class provides an alternative interface that handles
    custom control states at initialization, but the _define() interface is
    still valid even if it doesn't account for this. In #8571 we updated the
    QPY serialization code to use the _definition() method directly to
    correctly handle the open control case. But this fix neglected the case
    where people were providing definitions via the mechanism from Gate.
    This commit fixes this assumption by ensuring we load the definition
    that comes from _define() which will fix the serialization of these
    custom subclasses.
    
    Fixes #8794
    
    Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
    Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
    (cherry picked from commit 3fb8939)
    mtreinish authored and mergify[bot] committed Oct 18, 2022
    Configuration menu
    Copy the full SHA
    05d6c84 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d27b4ef View commit details
    Browse the repository at this point in the history