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

Some more polishing of the wires refactor #100

Merged
merged 2 commits into from
Aug 10, 2020
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
4 changes: 3 additions & 1 deletion pennylane_qiskit/aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class AerDevice(QiskitDevice):
`Aer provider documentation <https://qiskit.org/documentation/apidoc/aer_provider.html>`_.

Args:
wires (int): The number of qubits of the device
wires (int or Iterable[Number, str]]): Number of subsystems represented by the device,
or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
or strings (``['ancilla', 'q1', 'q2']``).
backend (str): the desired backend
shots (int): number of circuit evaluations/random samples used
to estimate expectation values and variances of observables
Expand Down
4 changes: 3 additions & 1 deletion pennylane_qiskit/basic_aer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class BasicAerDevice(QiskitDevice):
`Basic Aer provider documentation <https://qiskit.org/documentation/apidoc/providers_basicaer.html>`_.

Args:
wires (int): The number of qubits of the device
wires (int or Iterable[Number, str]]): Number of subsystems represented by the device,
or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
or strings (``['ancilla', 'q1', 'q2']``).
backend (str): the desired backend
shots (int): number of circuit evaluations/random samples used
to estimate expectation values and variances of observables
Expand Down
5 changes: 4 additions & 1 deletion pennylane_qiskit/ibmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ class IBMQDevice(QiskitDevice):
there is a credit system to limit access to the quantum devices.

Args:
wires (int): The number of qubits of the device
wires (int or Iterable[Number, str]]): Number of subsystems represented by the device,
or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
or strings (``['ancilla', 'q1', 'q2']``). Note that for some backends, the number
of wires has to match the number of qubits accessible.
provider (Provider): The IBM Q provider you wish to use. If not provided,
then the default provider returned by ``IBMQ.get_provider()`` is used.
backend (str): the desired provider backend
Expand Down
7 changes: 4 additions & 3 deletions pennylane_qiskit/qiskit_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ class QiskitDevice(QubitDevice, abc.ABC):
r"""Abstract Qiskit device for PennyLane.

Args:
wires (int): The number of qubits of the device
wires (int or Iterable[Number, str]]): Number of subsystems represented by the device,
or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
or strings (``['ancilla', 'q1', 'q2']``).
provider (Provider): The Qiskit simulation provider
backend (str): the desired backend
shots (int): Number of circuit evaluations/random samples used
Expand All @@ -84,7 +86,7 @@ class QiskitDevice(QubitDevice, abc.ABC):
Default value is ``False``.
"""
name = "Qiskit PennyLane plugin"
pennylane_requires = ">=0.9.0"
pennylane_requires = ">=0.11.0"
version = "0.9.0"
plugin_version = __version__
author = "Xanadu"
Expand Down Expand Up @@ -328,6 +330,5 @@ def analytic_probability(self, wires=None):
if self._state is None:
return None

wires = wires or range(self.num_wires)
prob = self.marginal_prob(np.abs(self._state) ** 2, wires)
return prob