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

Avoid private methods when adding unused Parameters #34

Merged
merged 1 commit into from
Jun 5, 2024

Commits on Jun 4, 2024

  1. Avoid private methods when adding unused Parameters

    Using private methods of `QuantumCircuit` to force tracking of unused
    `Parameter` instances resulting in the cleanest circuit output, but was
    fragile against Qiskit changing the private data structure internals.
    This has been a real problem as Qiskit moves more of the internal data
    tracking down to Rust space.
    
    This changes the hacked-in tracking to use only public methods to insert
    a dummy reference, at the cost that a _true_ reference is added in to
    the global phase.  For most real-world uses of unused parameters (i.e.
    those in gate bodies), this will immediately be assigned out and so be
    invisible to users.  The only place where this should appear to users is
    if there is an `input float` that is unused.  In these cases, a dummy
    reference will be inserted into the global phase that has no effect.
    jakelishman committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    c70adfb View commit details
    Browse the repository at this point in the history