Skip to content

Commit

Permalink
Merge branch 'master' into load
Browse files Browse the repository at this point in the history
  • Loading branch information
astralcai authored Mar 11, 2024
2 parents 5609168 + f4156d3 commit daf2a7f
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions pennylane_rigetti/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Plugin overview
===============
"""

from .ops import CPHASE
from .qpu import QPUDevice
from .qvm import QVMDevice
Expand Down
2 changes: 2 additions & 0 deletions pennylane_rigetti/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
Code details
~~~~~~~~~~~~
"""

import uuid

import numpy as np
Expand Down Expand Up @@ -178,6 +179,7 @@ class RigettiDevice(QubitDevice):
to estimate expectation values of observables.
For simulator devices, 0 means the exact EV is returned.
"""

pennylane_requires = ">=0.18"
version = __version__
author = "Rigetti Computing Inc."
Expand Down
2 changes: 2 additions & 0 deletions pennylane_rigetti/numpy_wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Code details
~~~~~~~~~~~~
"""

from pyquil.pyqvm import PyQVM
from pyquil.simulation import NumpyWavefunctionSimulator

Expand All @@ -36,6 +37,7 @@ class NumpyWavefunctionDevice(RigettiDevice):
shots (int): Number of circuit evaluations/random samples used
to estimate expectation values of observables.
"""

name = "pyQVM NumpyWavefunction Simulator Device"
short_name = "rigetti.numpy_wavefunction"

Expand Down
2 changes: 2 additions & 0 deletions pennylane_rigetti/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Code details
~~~~~~~~~~~~
"""

import pennylane as qml
from pennylane.operation import Operation

Expand Down Expand Up @@ -53,6 +54,7 @@ class CPHASE(Operation):
gets applied
wires (int): the subsystem the gate acts on
"""

num_params = 2
num_wires = 2
par_domain = "R"
Expand Down
1 change: 1 addition & 0 deletions pennylane_rigetti/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class QuantumComputerDevice(RigettiDevice, ABC):
parametric_compilation (bool): a boolean value of whether or not to use parametric
compilation.
"""

version = __version__
author = "Rigetti Computing Inc."

Expand Down
2 changes: 2 additions & 0 deletions pennylane_rigetti/qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Code details
~~~~~~~~~~~~
"""

import warnings

import numpy as np
Expand Down Expand Up @@ -74,6 +75,7 @@ class QPUDevice(QuantumComputerDevice):
parametric_compilation (bool): a boolean value of whether or not to use parametric
compilation.
"""

name = "Rigetti QPU Device"
short_name = "rigetti.qpu"

Expand Down
2 changes: 2 additions & 0 deletions pennylane_rigetti/qvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Code details
~~~~~~~~~~~~
"""

import networkx as nx
from pyquil import get_qc
from pyquil.api import QuantumComputer, QuantumExecutable
Expand Down Expand Up @@ -62,6 +63,7 @@ class QVMDevice(QuantumComputerDevice):
parametric_compilation (bool): a boolean value of whether or not to use parametric
compilation.
"""

name = "Rigetti QVM Device"
short_name = "rigetti.qvm"

Expand Down
2 changes: 2 additions & 0 deletions pennylane_rigetti/wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
Code details
~~~~~~~~~~~~
"""

import numpy as np

from pyquil.api import WavefunctionSimulator
Expand Down Expand Up @@ -55,6 +56,7 @@ class WavefunctionDevice(RigettiDevice):
shots (int): Number of circuit evaluations/random samples used
to estimate expectation values of observables.
"""

name = "Rigetti Wavefunction Simulator Device"
short_name = "rigetti.wavefunction"

Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Default parameters, commandline arguments and common routines for the unit tests.
"""

from unittest.mock import MagicMock, patch
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/test_device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for the abstract RigettiDevice class
"""

from unittest.mock import patch
import pytest

Expand Down
1 change: 1 addition & 0 deletions tests/test_gradients.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Integration tests for quantum gradient computations.
"""

import pennylane as qml
from pennylane import numpy as np

Expand Down
1 change: 1 addition & 0 deletions tests/test_numpy_wavefunction.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for the wavefunction simulator device.
"""

import logging

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_pyqvm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for the pyQVM simulator device.
"""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/test_qpu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for the QPU device.
"""

import logging

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/test_qvm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for the QVM simulator device.
"""

import logging

import networkx as nx
Expand Down
1 change: 1 addition & 0 deletions tests/test_wavefunction.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for the wavefunction simulator device.
"""

import logging

import pytest
Expand Down

0 comments on commit daf2a7f

Please sign in to comment.