Skip to content

Conversation

ismaila-at-za-ibm
Copy link
Contributor

@ismaila-at-za-ibm ismaila-at-za-ibm commented May 3, 2018

Description

Removed self.name as first argument in function reapply (InitializeGate fixes the name to "init", is there a need to allow for an arbitrary name?).

Motivation and Context

fixes #433
fixes #409

How Has This Been Tested?

Included a new test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed (I tested the new test, the others should pass since no other changes were made).

@diego-plan9
Copy link
Member

diego-plan9 commented May 3, 2018

Thanks, @ismaila-at-za-ibm ! Can you revise the new test_combiner check? It seems to be passing when using the Python simulator, but failing when using the C++ simulator, with:

quantum_state = result.get_data("H1_and_H2")['quantum_state']

being the problematic line (KeyError: 'quantum_state').

@ajavadia
Copy link
Member

ajavadia commented May 3, 2018

@ismaila-at-za-ibm thanks for the PR!

after #435, the correct key is now statevector and not quantum_state.
There is also a more convenient function result.get_statevector("H1_and_H2")

@ajavadia
Copy link
Member

ajavadia commented May 7, 2018

@ismaila-at-za-ibm I made one PR into your branch to just remove any remaining use of quantum program, in line with newer qiskit conventions. After you merge that, then I think we are good to merge here.
thanks!

remove all quantumprogram use cases
@diego-plan9
Copy link
Member

Thanks @ismaila-at-za-ibm and @ajavadia !

@diego-plan9 diego-plan9 merged commit 4104534 into Qiskit:master May 8, 2018
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
* Fixed Bug Qiskit#409 and duplicate Qiskit#433, and added new test.

* Incorporated Diego and Ali's suggestions

* Made further changes as suggested by Ali (bringing latest test in line with the other tests)

* remove all uses of QuantumProgram in test_initializer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circuits obtained from initialize cannot be combined A bug in circuit initialization
3 participants