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

Fixes a bug where backend_options would be passed to backends that don't support it. #51

Merged
merged 4 commits into from
Sep 14, 2019

Conversation

josh146
Copy link
Member

@josh146 josh146 commented Sep 13, 2019

Context: The current QiskitDevice assumes that all backends accept backend options, but this isn't the case --- hardware backends on IBMQ do not accept backend options. This leads to an TypeError for hardware-bound jobs.

Description of change:

  • inspect.signature is used to determine what keyword arguments the backend supports.

  • A new attribute self.run_args is now used to correctly store a dictionary of allowed keyword arguments.

  • Version number incrementation for a minor bugfix release.

Benefits: Fixes the bug

GitHub Issues: https://discuss.pennylane.ai/t/pennylane-qiskit-error/204

@josh146 josh146 added the bug Something isn't working label Sep 13, 2019
@codecov
Copy link

codecov bot commented Sep 13, 2019

Codecov Report

Merging #51 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   99.34%   99.35%   +<.01%     
==========================================
  Files           8        8              
  Lines         307      311       +4     
==========================================
+ Hits          305      309       +4     
  Misses          2        2
Impacted Files Coverage Δ
pennylane_qiskit/ibmq.py 100% <ø> (ø) ⬆️
pennylane_qiskit/_version.py 100% <100%> (ø) ⬆️
pennylane_qiskit/aer.py 100% <100%> (ø) ⬆️
pennylane_qiskit/qiskit_device.py 99.03% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9aed690...467b942. Read the comment docs.

@josh146 josh146 added the WIP label Sep 13, 2019
@josh146 josh146 changed the title Fixes a bug where backend_options would be passed to backends that don't support it. [WIP] Fixes a bug where backend_options would be passed to backends that don't support it. Sep 13, 2019
@josh146 josh146 added review-ready and removed WIP labels Sep 13, 2019
@josh146 josh146 changed the title [WIP] Fixes a bug where backend_options would be passed to backends that don't support it. Fixes a bug where backend_options would be passed to backends that don't support it. Sep 13, 2019
Copy link
Member

@co9olguy co9olguy left a comment

Choose a reason for hiding this comment

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

Approved, but a couple small questions and comments

super().__init__(wires, qiskit.Aer, backend=backend, shots=shots, **kwargs)
self._noise_model = noise_model

def run(self, qobj):
Copy link
Member

Choose a reason for hiding this comment

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

how come this was removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I noticed that this was part of the same bug. There were no tests for noise models, so it wasn't picked up. Since the logic for kwargs is now part of the base class, this method is redundant and can be removed.

tests/test_integration.py Outdated Show resolved Hide resolved
@josh146 josh146 merged commit 68f6969 into master Sep 14, 2019
@josh146 josh146 deleted the fix_ibmq_backend_options branch September 14, 2019 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working review-ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants