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

Set analytic=False as default #64

Merged
merged 1 commit into from
Nov 21, 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
2 changes: 1 addition & 1 deletion pennylane_qiskit/aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class AerDevice(QiskitDevice):
to simulate a device compliant circuit, you can specify a backend here.
analytic (bool): For statevector backends, determines if the
expectation values and variances are to be computed analytically.
Default value is ``True``.
Default value is ``False``.
noise_model (NoiseModel): NoiseModel Object from ``qiskit.providers.aer.noise``
"""

Expand Down
2 changes: 1 addition & 1 deletion pennylane_qiskit/basic_aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class BasicAerDevice(QiskitDevice):
to simulate a device compliant circuit, you can specify a backend here.
analytic (bool): For statevector backends, determines if the
expectation values and variances are to be computed analytically.
Default value is ``True``.
Default value is ``False``.
"""

short_name = "qiskit.basicaer"
Expand Down
4 changes: 2 additions & 2 deletions pennylane_qiskit/qiskit_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class QiskitDevice(Device, abc.ABC):
to simulate a device compliant circuit, you can specify a backend here.
analytic (bool): For statevector backends, determines if the
expectation values and variances are to be computed analytically.
Default value is ``True``.
Default value is ``False``.
"""
name = "Qiskit PennyLane plugin"
pennylane_requires = ">=0.8.0"
Expand All @@ -140,7 +140,7 @@ class QiskitDevice(Device, abc.ABC):
def __init__(self, wires, provider, backend, shots=1024, **kwargs):
super().__init__(wires=wires, shots=shots)

self.analytic = kwargs.pop("analytic", True)
self.analytic = kwargs.pop("analytic", False)

if "verbose" not in kwargs:
kwargs["verbose"] = False
Expand Down
8 changes: 4 additions & 4 deletions tests/test_qiskit_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_warning_raised_for_hardware_backend_analytic_expval(self, hardware_back
"""Tests that a warning is raised if the analytic attribute is true on
hardware simulators when calculating the expectation"""

dev = qml.device("qiskit.basicaer", backend=hardware_backend, wires=2)
dev = qml.device("qiskit.basicaer", backend=hardware_backend, wires=2, analytic=True)

@qml.qnode(dev)
def circuit():
Expand All @@ -66,7 +66,7 @@ def test_no_warning_raised_for_software_backend_analytic_expval(self, statevecto
"""Tests that no warning is raised if the analytic attribute is true on
statevector simulators when calculating the expectation"""

dev = qml.device("qiskit.basicaer", backend=statevector_backend, wires=2)
dev = qml.device("qiskit.basicaer", backend=statevector_backend, wires=2, analytic=True)

@qml.qnode(dev)
def circuit():
Expand All @@ -82,7 +82,7 @@ def test_warning_raised_for_hardware_backend_analytic_var(self, hardware_backend
"""Tests that a warning is raised if the analytic attribute is true on
hardware simulators when calculating the variance"""

dev = qml.device("qiskit.basicaer", backend=hardware_backend, wires=2)
dev = qml.device("qiskit.basicaer", backend=hardware_backend, wires=2, analytic=True)

@qml.qnode(dev)
def circuit():
Expand All @@ -103,7 +103,7 @@ def test_no_warning_raised_for_software_backend_analytic_var(self, statevector_b
"""Tests that no warning is raised if the analytic attribute is true on
statevector simulators when calculating the variance"""

dev = qml.device("qiskit.basicaer", backend=statevector_backend, wires=2)
dev = qml.device("qiskit.basicaer", backend=statevector_backend, wires=2, analytic=True)

@qml.qnode(dev)
def circuit():
Expand Down