Skip to content

Commit

Permalink
Merge pull request #53 from XanaduAI/fix_#52
Browse files Browse the repository at this point in the history
Remove opening of requirements.txt from setup.py
  • Loading branch information
josh146 committed Jul 30, 2019
2 parents 9ca9e59 + e04cd4c commit b62e450
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 42 deletions.
2 changes: 1 addition & 1 deletion pennylane_pq/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = '0.4.0'
__version__ = '0.5.0-dev'
68 changes: 29 additions & 39 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,34 @@
from setuptools import setup

with open("pennylane_pq/_version.py") as f:
version = f.readlines()[-1].split()[-1].strip("\"'") #pylint: disable=invalid-name
version = f.readlines()[-1].split()[-1].strip("\"'") # pylint: disable=invalid-name


with open("requirements.txt") as f:
requirements = [ #pylint: disable=invalid-name
'projectq>=0.4.1',
'pennylane>=0.4'
]
requirements = ["projectq>=0.4.1", "pennylane>=0.4"] # pylint: disable=invalid-name

info = { #pylint: disable=invalid-name
'name': 'PennyLane-PQ',
'version': version,
'maintainer': 'Xanadu Inc.',
'maintainer_email': 'christiangogolin@xanadu.ai',
'url': 'http://xanadu.ai',
'license': 'Apache License 2.0',
'packages': [
'pennylane_pq'
],
'entry_points': {
'pennylane.plugins': [
'projectq.simulator = pennylane_pq:ProjectQSimulator',
'projectq.classical = pennylane_pq:ProjectQClassicalSimulator',
'projectq.ibm = pennylane_pq:ProjectQIBMBackend',
],
},
'description': 'PennyLane plugin for ProjectQ',
'long_description': open('README.rst').read(),
'provides': ["pennylane_pq"],
'install_requires': requirements,
# 'extras_require': extra_requirements,
'command_options': {
'build_sphinx': {
'version': ('setup.py', version),
'release': ('setup.py', version)}}

info = { # pylint: disable=invalid-name
"name": "PennyLane-PQ",
"version": version,
"maintainer": "Xanadu Inc.",
"maintainer_email": "christiangogolin@xanadu.ai",
"url": "http://xanadu.ai",
"license": "Apache License 2.0",
"packages": ["pennylane_pq"],
"entry_points": {
"pennylane.plugins": [
"projectq.simulator = pennylane_pq:ProjectQSimulator",
"projectq.classical = pennylane_pq:ProjectQClassicalSimulator",
"projectq.ibm = pennylane_pq:ProjectQIBMBackend",
]
},
"description": "PennyLane plugin for ProjectQ",
"long_description": open("README.rst").read(),
"provides": ["pennylane_pq"],
"install_requires": requirements,
}

classifiers = [ #pylint: disable=invalid-name
classifiers = [ # pylint: disable=invalid-name
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
Expand All @@ -64,12 +54,12 @@
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3 :: Only',
"Topic :: Scientific/Engineering :: Physics"
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Physics",
]

setup(classifiers=classifiers, **(info))
3 changes: 3 additions & 0 deletions tests/test_compare_with_default_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def circuit():
operation_wires = list(range(operation_class.num_wires)) if operation_class.num_wires > 1 else 0
observable_wires = list(range(observable_class.num_wires)) if observable_class.num_wires > 1 else 0

if str(operation) == "QubitStateVector":
operation_wires = range(self.num_subsystems)

operation_class(*operation_pars, wires=operation_wires)
return qml.expval(observable_class(*observable_pars, wires=observable_wires))

Expand Down
4 changes: 2 additions & 2 deletions tests/test_unsupported_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_unsupported_operation(self):
@qml.qnode(device)
def circuit():
qml.Beamsplitter(0.2, 0.1, wires=[0,1]) #this expectation will never be supported
return qml.expval(qml.Homodyne(0.7, 0))
return qml.expval(qml.QuadOperator(0.7, 0))

self.assertRaises(pennylane._device.DeviceError, circuit)

Expand All @@ -74,7 +74,7 @@ def test_unsupported_expectation(self):
for device in self.devices:
@qml.qnode(device)
def circuit():
return qml.expval(qml.Homodyne(0.7, 0)) #this expectation will never be supported
return qml.expval(qml.QuadOperator(0.7, 0)) #this expectation will never be supported

self.assertRaises(pennylane._device.DeviceError, circuit)

Expand Down

0 comments on commit b62e450

Please sign in to comment.