Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Cynocracy committed May 13, 2022
1 parent 7368675 commit ceff13b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions pennylane_ionq/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class IonQDevice(QubitDevice):
wires (int or Iterable[Number, str]]): Number of wires to initialize the device with,
or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
or strings (``['ancilla', 'q1', 'q2']``).
gateset (str): the target gateset, either ``"qis"`` or ``"native"``.
shots (int, list[int]): Number of circuit evaluations/random samples used to estimate
expectation values of observables.
If a list of integers is passed, the circuit evaluations are batched over the list of shots.
Expand Down
17 changes: 11 additions & 6 deletions pennylane_ionq/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
class GPI(Operation): # pylint: disable=too-few-public-methods
r"""GPI(phi, wires)
Single-qubit GPI gate.
.. math::
GPI(\phi) =
GPI(\phi) =
\begin{pmatrix}
0 & e^{-i*2*\pi*\phi} \\
e^{-i*2*\pi*\phi} & 0
Expand All @@ -32,14 +34,16 @@ class GPI(Operation): # pylint: disable=too-few-public-methods
"""
num_params = 1
num_wires = 1
grad_method = "None"
grad_method = None


class GPI2(Operation): # pylint: disable=too-few-public-methods
r"""GPI2(phi, wires)
Single-qubit GPI2 gate.
.. math::
GPI2(\phi) =
GPI2(\phi) =
\begin{pmatrix}
1 & -i*e^{-i*2*\pi*\phi} \\
-i*e^{i*2*\pi*\phi} & 1
Expand All @@ -50,14 +54,15 @@ class GPI2(Operation): # pylint: disable=too-few-public-methods
"""
num_params = 1
num_wires = 1
par_domain = "R"
grad_method = "None"
grad_method = None


class MS(Operation): # pylint: disable=too-few-public-methods
r"""MS(phi1, phi2, wires)
Single-qubit GPI2 gate.
.. math::
MS(\phi_0, _\phi_1) q_0, q_1 =
\frac{1}{\sqrt{2}}\begin{pmatrix}
1 & 0 & 0 & -i*e^(-i*2*\pi*(\phi_0+\phi_1) \\
Expand All @@ -71,7 +76,7 @@ class MS(Operation): # pylint: disable=too-few-public-methods
"""
num_params = 2
num_wires = 2
grad_method = "None"
grad_method = None


# Custom operations for the QIS Gateset below
Expand Down

0 comments on commit ceff13b

Please sign in to comment.