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

Add samples and variance support #46

Merged
merged 6 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pennylane_qiskit/aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class AerDevice(QiskitDevice):
compile_backend (BaseBackend): The backend used for compilation. If you wish
to simulate a device compliant circuit, you can specify a backend here.
"""

# pylint: disable=too-many-arguments

short_name = "qiskit.aer"
Expand All @@ -73,15 +74,17 @@ def __init__(
shots=1024,
backend="qasm_simulator",
noise_model=None,
backend_options=None,
**kwargs
):
super().__init__(wires, qiskit.Aer, backend=backend, shots=shots, **kwargs)
self._noise_model = noise_model
self._backend_options = backend_options

def run(self, qobj):
"""Run the compiled circuit, and query the result."""
self._current_job = self.backend.run(
qobj, noise_model=self._noise_model, backend_options=self.kwargs
)
self._current_job.result()
result = self._current_job.result()

if self.backend_name in self._state_backends:
self._state = self._get_state(result)
1 change: 0 additions & 1 deletion pennylane_qiskit/ibmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class IBMQDevice(QiskitDevice):
"""

short_name = "qiskit.ibmq"
_backend_kwargs = ["verbose", "backend", "ibmqx_token", "ibmqx_url"]

def __init__(self, wires, provider=None, backend="ibmq_qasm_simulator", shots=1024, **kwargs):
token = os.getenv("IBMQX_TOKEN") or kwargs.get("ibmqx_token", None)
Expand Down
Loading