Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

OperatorStateFn: bind parameters in coeff and primitive #1085

Merged
merged 4 commits into from
Jul 1, 2020

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Jul 1, 2020

Summary

Fixes operator propagation in OperatorStateFn which missed the parameters in the primitive.

Details and comments

E.g.

        theta = ParameterVector('theta', 2)
        op = StateFn(theta[0] * X) * theta[1]
        bound = op.assign_parameters(dict(zip(theta, [0.2, 0.3])))
        print(bound.coeff, bound.primitive.coeff)

Yielded before: 0.3, theta[0], and now 0.3, 0.2.

@Cryoris Cryoris added the Changelog: Bugfix Include in the Fixed section of the changelog label Jul 1, 2020
@woodsp-ibm woodsp-ibm added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jul 1, 2020
@Cryoris Cryoris merged commit b040e2c into qiskit-community:master Jul 1, 2020
@Cryoris Cryoris deleted the opstatefn-param-bind branch July 1, 2020 20:25
manoelmarques added a commit to manoelmarques/qiskit-aqua that referenced this pull request Jul 28, 2020
…nity#1085)

* fix param binding of primitive

* add test

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
pbark pushed a commit to pbark/qiskit-aqua that referenced this pull request Sep 16, 2020
…nity#1085)

* fix param binding of primitive

* add test

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
mtreinish pushed a commit to mtreinish/qiskit-core that referenced this pull request Nov 20, 2020
…nity/qiskit-aqua#1085)

* fix param binding of primitive

* add test

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
manoelmarques added a commit to manoelmarques/qiskit-terra that referenced this pull request Dec 2, 2020
…nity/qiskit-aqua#1085)

* fix param binding of primitive

* add test

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
manoelmarques added a commit to manoelmarques/qiskit-terra that referenced this pull request Dec 7, 2020
…nity/qiskit-aqua#1085)

* fix param binding of primitive

* add test

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog: Bugfix Include in the Fixed section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants