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

Build BlueprintCircuit before inverse and compose #5170

Merged
merged 6 commits into from
Oct 6, 2020

Conversation

georgios-ts
Copy link
Contributor

Summary

Assert a call on _build method of a BlueprintCircuit if inverse or compose is called in order to populate internal _data field.

Details and comments

Previously, as reported on #5140, the following would fail since _data is still None.

var_form = EfficientSU2(2, entanglement="linear")
var_form.inverse()
---
raises TypeError
---
qc = QuantumCircuit(2)
qc.h([0, 1])

var_form.compose(qc, inplace=True)
---
raises TypeError
---

As with other attributes, before internal data of the circuit is accessed on inverse and compose functions, the _build method is called.

@georgios-ts georgios-ts requested a review from a team as a code owner October 2, 2020 10:03
@kdk kdk linked an issue Oct 2, 2020 that may be closed by this pull request
@kdk kdk added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Oct 2, 2020
Copy link
Member

@kdk kdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @georgios-ts ! Can you add a release note?

@Cryoris Cryoris added this to the 0.16 milestone Oct 2, 2020
@kdk kdk added the automerge label Oct 6, 2020
@mergify mergify bot merged commit c894c44 into Qiskit:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BlueprintCircuit should build whenever data is required
3 participants