Git Product home page Git Product logo

qiskit-aqua's Introduction

Qiskit Aqua

LicenseBuild Status

Qiskit is an open-source framework for working with noisy intermediate-scale quantum (NISQ) computers at the level of pulses, circuits, algorithms, and applications.

Qiskit is made up elements that work together to enable quantum computing. This element is Aqua. Aqua provides a library of cross-domain algorithms upon which domain-specific applications can be built. Qiskit Chemistry has been created to utilize Aqua for quantum chemistry computations. Aqua is also showcased for other domains, such as Optimization, Artificial Intelligence, and Finance, with both code and notebook examples available in the qiskit/aqua and community/aqua folders of the qiskit-tutorials GitHub Repository.

Aqua was designed to be extensible, and uses a pluggable framework where algorithms and support objects used by algorithms—such as optimizers, variational forms, and oracles—are derived from a defined base class for the type and discovered dynamically at run time.

Installation

Qiskit Aqua is part of the Qiskit software framework. We encourage installing Qiskit Aqua as part of Qiskit via the pip tool (a python package manager):

pip install qiskit

pip will handle all dependencies automatically for you, including the other Qiskit elements upon which Aqua is built, such as Qiskit Terra, and you will always install the latest (and well-tested) version.

To install from source, follow the instructions in the contribution guidelines.

Please note that one of Aqua's dependencies, PyEDA, which is used in Aqua's LogicalExpressionOracle and TruthTableOracle implementations, will not be automatically installed on the Windows platform. You can follow these notes to manually install PyEDA on Windows if necessary.

Creating Your First Quantum Program in Qiskit Aqua

Now that Qiskit Aqua is installed, it's time to begin working with it. We are ready to try out an experiment using Qiskit Aqua:

$ python
from qiskit import Aer
from qiskit.aqua.components.oracles import LogicalExpressionOracle
from qiskit.aqua.algorithms import Grover

sat_cnf = """
c Example DIMACS 3-sat
p cnf 3 5
-1 -2 -3 0
1 -2 3 0
1 2 -3 0
1 -2 -3 0
-1 2 3 0
"""

backend = Aer.get_backend('qasm_simulator')
oracle = LogicalExpressionOracle(sat_cnf)
algorithm = Grover(oracle)
result = algorithm.run(backend)
print(result["result"])

The code above demonstrates how Grover’s search algorithm can be used with the LogicalExpressionOracle to find one satisfying assignment for the Satisfiability (SAT) problem instance encoded in the DIMACS CNF format. The input string sat_cnf corresponds to the following Conjunctive Normal Form (CNF):

x1 ∨ ¬x2 ∨ ¬x3) ∧ (x1 ∨ ¬x2x3) ∧ (x1x2 ∨ ¬x3) ∧ (x1 ∨ ¬x2 ∨ ¬x3) ∧ (¬x1x2x3)

The Python code above prints out one possible solution for this CNF. For example, output 1, -2, 3 indicates that logical expression (x1 ∨ ¬x2x3) satisfies the given CNF.

You can also use Qiskit to execute your code on a real quantum chip. In order to do so, you need to configure Qiskit to use the credentials in your IBM Q account. Please consult the relevant instructions in the Qiskit Terra GitHub repository for more details.

Contribution Guidelines

If you'd like to contribute to Qiskit, please take a look at our contribution guidelines. This project adheres to Qiskit's code of conduct. By participating, you are expected to uphold to this code.

We use GitHub issues for tracking requests and bugs. Please join the Qiskit Slack community and use the Aqua Slack channel for discussion and simple questions. For questions that are more suited for a forum, we use the Qiskit tag in Stack Overflow.

Next Steps

Now you're set up and ready to check out some of the other examples from the qiskit/aqua and community/aqua folders of the qiskit-tutorials GitHub Repository.

Authors and Citation

Aqua was inspired, authored and brought about by the collective work of a team of researchers. Aqua continues to grow with the help and work of many people, who contribute to the project at different levels. If you use Qiskit, please cite as per the included BibTeX file.

License

Apache License 2.0

qiskit-aqua's People

Contributors

a-matsuo avatar abdonrd avatar ajavadia avatar antoniomezzacapo avatar apozas avatar attp avatar chunfuchen avatar dabucher avatar dbucher97 avatar dominik-steenken avatar dongreenberg avatar gawelkus avatar gitcyberian avatar gnannicini avatar hushaohan avatar ikkoham avatar jaygambetta avatar jmarecek avatar jmueg avatar liupibm avatar manoelmarques avatar mtreinish avatar nick-singstock avatar pistoia avatar stefan-woerner avatar t-imamichi avatar tigerjack avatar woodsp-ibm avatar yaelbh avatar zoufalc avatar

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.