-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README and build instructions on Mac #2
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,92 @@ | ||
# Qiskit-Aer | ||
# Qiskit Aer | ||
|
||
This is a working draft for the Qiskit-Aer simulator framework for Qiskit-Terra. This is the development repository and has no guarantee of stability or correctness. | ||
[![PyPI](https://img.shields.io/pypi/v/qiskit.svg)](https://pypi.python.org/pypi/qiskit-aer) | ||
|
||
**Qiskit** is an open-source framework for working with noisy intermediate-scale quantum computers (NISQ) at the level of pulses, circuits, and algorithms. | ||
|
||
## Repository contents | ||
Qiskit is made up of elements that each work together to enable quantum computing. This element is **Aer**, which provides high-performance quantum computing simulators with realistic noise models. | ||
|
||
* The **qiskit_aer** folder contains the Qiskit-Aer python module for use with Qiskit-Terra. | ||
* The **cmake** folder contains cmake scripts for building the simulator | ||
* The **src** folder contains the C++ source files for building the simulator. | ||
* The **contrib** folder for external contributions. | ||
* The **test** folder contains simulator unit tests. | ||
## Installation | ||
|
||
## Documentation | ||
We encourage installing Qiskit via the PIP tool (a python package manager), which installs all Qiskit elements, including this one. | ||
|
||
There's a [contributing guide](https://github.ibm.com/IBMQuantum/qiskit-aer/blob/master/.github/CONTRIBUTING.rst) | ||
with more detailed information about the project. | ||
```bash | ||
pip install qiskit | ||
``` | ||
|
||
For tutorials on using Qiskit Aer visit the [qiskit-tutorials](https://github.com/Qiskit/qiskit-tutorials/tree/master/qiskit/aer) Github repository. | ||
PIP will handle all dependencies automatically for us and you will always install the latest (and well-tested) version. | ||
|
||
To install from source, follow the instructions in the [contribution guidelines](.github/CONTRIBUTING.rst). | ||
|
||
## Installation | ||
|
||
Follow these steps for installing the **Qiskit Aer** package: | ||
|
||
```bash | ||
qiskit-aer$ pip install -r requirements-dev.txt | ||
qiskit-aer$ python ./setup.py bdist_wheel | ||
## Simulating your first quantum program with Qiskit Aer | ||
Now that you have Qiskit Aer installed, you can start simulating quantum circuits with noise. Here is a basic example: | ||
|
||
``` | ||
$ python | ||
``` | ||
|
||
Once the build finishes, we just need to install the wheel package in our | ||
preferred python virtual environment: | ||
```python | ||
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute | ||
from qiskit import Aer, IBMQ # import the Aer and IBMQ providers | ||
from qiskit.providers.aer import noise # import Aer noise models | ||
|
||
```bash | ||
qiskit-aer$ pip install dist/qiskit_aer-0.1.0-cp36-cp36m-linux_x86_64.whl | ||
# Choose a real device to simulate | ||
IBMQ.load_accounts() | ||
device = IBMQ.get_backend('ibmq_16_melbourne') | ||
properties = device.properties() | ||
coupling_map = device.configuration().coupling_map | ||
|
||
# Generate an Aer noise model for device | ||
noise_model = noise.device.basic_device_noise_model(properties) | ||
basis_gates = noise_model.basis_gates | ||
|
||
# Generate a quantum circuit | ||
q = QuantumRegister(2) | ||
c = ClassicalRegister(2) | ||
qc = QuantumCircuit(q, c) | ||
|
||
qc.h(q[0]) | ||
qc.cx(q[0], q[1]) | ||
qc.measure(q, c) | ||
|
||
# Perform noisy simulation | ||
backend = Aer.get_backend('qasm_simulator') | ||
job_sim = execute(qc, backend, | ||
coupling_map=coupling_map, | ||
noise_model=noise_model, | ||
basis_gates=basis_gates) | ||
sim_result = job_sim.result() | ||
|
||
print(sim_result.get_counts(qc)) | ||
``` | ||
|
||
We are all set! Now we ready to start using the simulator in our python code: | ||
```python | ||
from qiskit import Aer # Imports the Aer Provider | ||
|
||
Aer.backends() # List of the backends | ||
{'11': 412, '00': 379, '10': 117, '01': 116} | ||
``` | ||
|
||
|
||
## Contribution guidelines | ||
|
||
If you'd like to contribute to Qiskit Aer, please take a look at our | ||
[contribution guidelines](.github/CONTRIBUTING.rst). This project adheres to Qiskit's [code of conduct](.github/CODE_OF_CONDUCT.rst). By participating, you are expect to uphold this code. | ||
|
||
We use [GitHub issues](https://github.com/Qiskit/qiskit-aer/issues) for tracking requests and bugs. | ||
Please use our [slack](https://qiskit.slack.com) for discussion. To join our Slack community use the [link](https://join.slack.com/t/qiskit/shared_invite/enQtNDc2NjUzMjE4Mzc0LTMwZmE0YTM4ZThiNGJmODkzN2Y2NTNlMDIwYWNjYzA2ZmM1YTRlZGQ3OGM0NjcwMjZkZGE0MTA4MGQ1ZTVmYzk). | ||
|
||
|
||
### Next Steps | ||
|
||
Now you're set up and ready to check out some of the other examples from our | ||
[Qiskit Tutorials](https://github.com/Qiskit/qiskit-tutorials/tree/master/qiskit/aer) repository. | ||
|
||
|
||
## Authors | ||
|
||
Qiskit Aer is the work of [many people](https://github.com/Qiskit/qiskit-aer/graphs/contributors) who contribute | ||
to the project at different levels. | ||
|
||
## License | ||
|
||
[Apache License 2.0](LICENSE.txt) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually the default, so there's no need for specifying STATIC_LINKING=False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i removed that.