Coder Social home page Coder Social logo

openql-org / quantpy Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 12.0 148 KB

Quantum computer system environment and libraries in Python

Home Page: http://quantpy.org/

License: BSD 3-Clause "New" or "Revised" License

Python 99.93% Shell 0.07%
python quantum-computing quantum-information quantum-algorithms quantum-computer-simulator quantum-program quantum-programming-language

quantpy's Introduction

quantpy

QuantPy is usefull libraries and emulator using Quantum Computer system in Python.

Installation

QuantPy has a hard dependency NumPy, SymPy, QISKit. You should install them first.

To install QuantPy itself, then simply run:

$ pip install quantpy

Bugs

Our issue tracker is at https://github.com/openql-org/quantpy/issues. Please report any bugs that you find. Or, even better, fork the repository on GitHub and create a pull request. We welcome all changes, big or small, and we will help you make the pull request if you are new to git.

License

QuantPy is BSD licensed, so you are free to use it whatever you like, be it academic, commercial, creating forks or derivatives, as long as you copy the BSD statement if you redistribute it (see the LICENSE file for details).

quantpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

quantpy's Issues

ibmq_executor doesn't work

version : 0.0.2.dev9

I have noticed I have broken the imbq_execute by the PR #33 .

[Reproduction steps]
execute this code.

from sympy.physics.quantum.gate import H
from sympy.physics.quantum.qubit import Qubit
from quantpy.sympy.qapply import qapply
import sympy
from quantpy.sympy.executor.classical_simulation_executor import ClassicalSimulationExecutor
from quantpy.sympy.executor.sympy_executor import SymPyExecutor
from quantpy.sympy.executor.ibmq_executor import IBMQExecutor

c = H(2)*H(1)*H(0)*Qubit('000')
assert isinstance(c, sympy.mul.Mul)
for executor in (SymPyExecutor(), ClassicalSimulationExecutor(), IBMQExecutor()):
    result = qapply(c, executor=executor)
    print(result)
    print(result.__class__)

[Expected]
the script executed without any errors

[Actual]
It failed with the following error.

$ python t.py
/Users/susumu/study/openql/quantpy/_v/lib/python3.6/site-packages/marshmallow/schema.py:364: ChangedInMarshmallow3Warning: strict=False is not recommended. In marshmallow 3.0, schemas will always be strict. See https://marshmallow.readthedocs.io/en/latest/upgrading.html#schemas-are-always-strict
  ChangedInMarshmallow3Warning
Traceback (most recent call last):
  File "t.py", line 11, in <module>
    for executor in (SymPyExecutor(), ClassicalSimulationExecutor(), IBMQExecutor()):
  File "/Users/susumu/study/openql/quantpy/quantpy/sympy/executor/ibmq_executor.py", line 34, in __init__
    quantum_program = qiskit.QuantumProgram()
AttributeError: module 'qiskit' has no attribute 'QuantumProgram'

Tried to pip install

I installed all the requisite packages but I keep getting these error messages during pip install.

ERROR: Could not find a version that satisfies the requirement qiskit-chemistry==0.5.0 (from qiskit==0.11.1->quantpy) (from versions: none)
ERROR: No matching distribution found for qiskit-chemistry==0.5.0 (from qiskit==0.11.1->quantpy)

`setup.py test` failed in develop branch

I have tried to run test in develop branch, but it failed with TypeError: qapply() missing 1 required positional argument: 'circuit'.

[environment]
MacOSX, 10.14.2 (Mojave)

[steps]

  1. clone repository
  2. create venv and enabled it python3 -m venv _e; . _e/bin/activate
  3. install dependencies by pip pip install -r requirements.txt
  4. execute setup.py python setup.py test

[expected]
test passed successfully

[actual]
test failed with the following errors.

$ python setup.py test
running test
running egg_info
writing quantpy.egg-info/PKG-INFO
writing dependency_links to quantpy.egg-info/dependency_links.txt
writing requirements to quantpy.egg-info/requires.txt
writing top-level names to quantpy.egg-info/top_level.txt
package init file 'quantpy/ising/__init__.py' not found (or not a regular file)
reading manifest file 'quantpy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'quantpy/ising/__pycache__'
writing manifest file 'quantpy.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 56, in <module>
    install_requires=_requirements(),
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/susumu/study/openql/quantpy/_e/lib/python3.6/site-packages/setuptools/command/test.py", line 210, in run
    self.run_tests()
  File "/Users/susumu/study/openql/quantpy/_e/lib/python3.6/site-packages/setuptools/command/test.py", line 231, in run_tests
    testRunner=self._resolve_as_ep(self.test_runner),
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py", line 93, in __init__
    self.parseArgs(argv)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py", line 123, in parseArgs
    self._do_discovery([])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py", line 228, in _do_discovery
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py", line 341, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py", line 398, in _find_tests
    full_path, pattern, namespace)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py", line 475, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/Users/susumu/study/openql/quantpy/_e/lib/python3.6/site-packages/setuptools/command/test.py", line 42, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py", line 190, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/Users/susumu/study/openql/quantpy/_e/lib/python3.6/site-packages/setuptools/command/test.py", line 42, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py", line 204, in loadTestsFromName
    test = obj()
TypeError: qapply() missing 1 required positional argument: 'circuit'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.