Giter VIP home page Giter VIP logo

qiskit-aer's Introduction

Aer - high performance quantum circuit simulation for Qiskit

License Build Tests

Aer is a high performance simulator for quantum circuits written in Qiskit, that includes realistic noise models.

Installation

We encourage installing Aer via the pip tool (a python package manager):

pip install qiskit-aer

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.

Installing GPU support

In order to install and run the GPU supported simulators on Linux, you need CUDA® 11.2 or newer previously installed. CUDA® itself would require a set of specific GPU drivers. Please follow CUDA® installation procedure in the NVIDIA® web.

If you want to install our GPU supported simulators, you have to install this other package:

pip install qiskit-aer-gpu

The package above is for CUDA&reg 12, so if your system has CUDA® 11 installed, install separate package:

pip install qiskit-aer-gpu-cu11

This will overwrite your current qiskit-aer package installation giving you the same functionality found in the canonical qiskit-aer package, plus the ability to run the GPU supported simulators: statevector, density matrix, and unitary.

Note: This package is only available on x86_64 Linux. For other platforms that have CUDA support, you will have to build from source. You can refer to the contributing guide for instructions on doing this.

Simulating your first Qiskit circuit with Aer

Now that you have Aer installed, you can start simulating quantum circuits using primitives and noise models. Here is a basic example:

$ python
from qiskit import transpile
from qiskit.circuit.library import RealAmplitudes
from qiskit.quantum_info import SparsePauliOp
from qiskit_aer import AerSimulator

sim = AerSimulator()
# --------------------------
# Simulating using estimator
#---------------------------
from qiskit_aer.primitives import EstimatorV2

psi1 = transpile(RealAmplitudes(num_qubits=2, reps=2), sim, optimization_level=0)
psi2 = transpile(RealAmplitudes(num_qubits=2, reps=3), sim, optimization_level=0)

H1 = SparsePauliOp.from_list([("II", 1), ("IZ", 2), ("XI", 3)])
H2 = SparsePauliOp.from_list([("IZ", 1)])
H3 = SparsePauliOp.from_list([("ZI", 1), ("ZZ", 1)])

theta1 = [0, 1, 1, 2, 3, 5]
theta2 = [0, 1, 1, 2, 3, 5, 8, 13]
theta3 = [1, 2, 3, 4, 5, 6]

estimator = EstimatorV2()

# calculate [ [<psi1(theta1)|H1|psi1(theta1)>,
#              <psi1(theta3)|H3|psi1(theta3)>],
#             [<psi2(theta2)|H2|psi2(theta2)>] ]
job = estimator.run(
    [
        (psi1, [H1, H3], [theta1, theta3]),
        (psi2, H2, theta2)
    ],
    precision=0.01
)
result = job.result()
print(f"expectation values : psi1 = {result[0].data.evs}, psi2 = {result[1].data.evs}")

# --------------------------
# Simulating using sampler
# --------------------------
from qiskit_aer.primitives import SamplerV2
from qiskit import QuantumCircuit

# create a Bell circuit
bell = QuantumCircuit(2)
bell.h(0)
bell.cx(0, 1)
bell.measure_all()

# create two parameterized circuits
pqc = RealAmplitudes(num_qubits=2, reps=2)
pqc.measure_all()
pqc = transpile(pqc, sim, optimization_level=0)
pqc2 = RealAmplitudes(num_qubits=2, reps=3)
pqc2.measure_all()
pqc2 = transpile(pqc2, sim, optimization_level=0)

theta1 = [0, 1, 1, 2, 3, 5]
theta2 = [0, 1, 2, 3, 4, 5, 6, 7]

# initialization of the sampler
sampler = SamplerV2()

# collect 128 shots from the Bell circuit
job = sampler.run([bell], shots=128)
job_result = job.result()
print(f"counts for Bell circuit : {job_result[0].data.meas.get_counts()}")
 
# run a sampler job on the parameterized circuits
job2 = sampler.run([(pqc, theta1), (pqc2, theta2)])
job_result = job2.result()
print(f"counts for parameterized circuit : {job_result[0].data.meas.get_counts()}")

# --------------------------------------------------
# Simulating with noise model from actual hardware
# --------------------------------------------------
from qiskit_ibm_runtime import QiskitRuntimeService
provider = QiskitRuntimeService(channel='ibm_quantum', token="set your own token here")
backend = provider.get_backend("ibm_kyoto")

# create sampler from the actual backend
sampler = SamplerV2.from_backend(backend)

# run a sampler job on the parameterized circuits with noise model of the actual hardware
bell_t = transpile(bell, AerSimulator(basis_gates=["ecr", "id", "rz", "sx"]), optimization_level=0)
job3 = sampler.run([bell_t], shots=128)
job_result = job3.result()
print(f"counts for Bell circuit w/noise: {job_result[0].data.meas.get_counts()}")

Contribution Guidelines

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

We use GitHub issues for tracking requests and bugs. Please use our slack for discussion and simple questions. To join our Slack community use the link. For questions that are more suited for a forum, we use the Qiskit tag in the Stack Exchange.

Next Steps

Now you're set up and ready to check out some of the other examples from the Aer documentation.

Authors and Citation

Aer is the 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-aer's People

Contributors

1ucian0 avatar arnaucasau avatar aromanro avatar atilag avatar cclauss avatar chriseclectic avatar cryoris avatar danbev avatar danpuzzuoli avatar derwind avatar doichanj avatar eric-arellano avatar gadial avatar garrison avatar hhorii avatar hitomitak avatar ikkoham avatar itoko avatar jakelishman avatar jaygambetta avatar jlatone avatar kanejess avatar merav-aharoni avatar mtreinish avatar nonhermitian avatar padraic-padraic avatar sfantao avatar vvilpas avatar wshanks avatar yaelbh avatar

Stargazers

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

Watchers

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

qiskit-aer's Issues

Terra-integrated tests not running (fix compilation step in instructions and fix "...import state_fidelity")

Informations

  • Qiskit AER version: 0.1.0
  • Operating system: macOS Mojave 10.14.2 (18C54)

What is the current behavior?

Aer's Terra-integrated tests not running, i.e.:
python -m unittest discover -s test -v

Steps to reproduce the problem

python -m unittest discover -s test -v

What is the expected behavior?

Tests run.

Suggested solutions

Fix the offending line of code in test/terra/utils/common.py

hone 'install from source' instructions in CONTRIBUTING file

Related to Qiskit/qiskit#84

Summary

Make sure Aer's CONTRIBUTING file stands on its own, so Aer's install doc can be removed.

Details

We want to synthesize install instructions for all Qiskit packages into a global Install Qiskit doc section, where the global install doc refers Qiskit contributors to each package's CONTRIBUTING file for details on how to install from source.

Currently, Aer's doc includes 'Install from Source' instructions here. This was an initial (incomplete) attempt to hone the current instructions in Aer's CONTRIBUTING file.

Aer's CONTRIBUTING file should be updated to stand on its own.

After Aer's CONTRIBUTING file is updated, the Installing Aer section of the doc will be removed.

Error: ImportError: cannot import name 'Aer' from 'qiskit' with Ananconda Linux

Informations

What is the current behavior?

Runtime error at statement: from qiskit import Aer
ImportError: cannot import name 'Aer' from 'qiskit' (/home/claude/anaconda3/envs/QiskitDevenv/lib/python3.7/site-packages/qiskit/init.py)

Steps to reproduce the problem

My install sequence:
conda create -y -n QiskitDevenv python=3
source activate QiskitDevenv

download zip https://github.com/Qiskit/qiskit-aqua.git
cd /home/claude/Downloads/qiskit-aqua/qiskit-aqua-master
pip install -r requirements.txt
pip install -r requirements-dev.txt

pip install git+https://github.com/Qiskit/qiskit.git
pip install git+https://github.com/Qiskit/qiskit-aer.git
pip install git+https://github.com/Qiskit/qiskit-terra.git
pip install git+https://github.com/Qiskit/qiskit-aqua.git
pip install git+https://github.com/Qiskit/qiskit-chemistry.git
conda install -n QiskitDevenv -c anaconda anaconda-navigator
conda install -n QiskitDevenv nbconvert
~/anaconda-navigator
launch Jupyter, execute notebook with chemistry pilot sample

pip list
..
qiskit 0.8.0
qiskit-aer 0.1.1
qiskit-aqua 0.4.2
qiskit-chemistry 0.4.3
qiskit-ignis 0.1.0
qiskit-terra 0.8.0
..

What is the expected behavior?

Successful import of class Aer from the installed qiskit package.

Suggested solutions

Improve benchmarking framework

We need to have this framework in place for the 0.2 release.

Additional features

  • Add benchmarks for measure / reset
  • Add benchmarks for structured circuits (eg from aqua algorithms).

Bugs to fix

  • Result figures include large chunks of qobj text
  • Build doesn't work on some systems since it hardcodes building with g++-7

Incorrect output for CH simulator for some simple circuits with t gates

Informations

  • Qiskit Aer version: master
  • Python version: 3.6
  • Operating system: MacOS

What is the current behavior?

@padraic-padraic I noticed some unusual behaviour while testing the CH simulator. If I run a bell preparation circuit and insert a t gate (which should not change the output) instead of returning {'00': shots / 2, '11': shots / 2}, it appears to return {'00' : shots} or {'11': shots}.

Steps to reproduce the problem

Test circuit that should return counts = {'00': shots / 2, '11': shots / 2} since the final t-gate commutes with the last measurement.

from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute
from qiskit.providers.aer import QasmSimulator
import numpy as np

# Test Circuit
qr = QuantumRegister(2, 'qr')
cr = ClassicalRegister(2, 'cr')
circ = QuantumCircuit(qr, cr)
circ.h(qr[0])
circ.cx(qr[0], qr[1])
circ.t(qr[0])
circ.measure(qr, cr)

# Execute
result = execute(circ, QasmSimulator(), backend_options={"method": "ch"}).result()
counts = result.get_counts(circ)

This returns either counts ={'00' : 1024} or counts = {'11' : 1024} with roughly even probability.

What is the expected behavior?

It should return something close to counts ={'00' : 512, '11': 512}.

Suggested solutions

I'm not sure, I mentioned the problem to Sergey and he is also looking into.

Use same BLAS implimentation as NumPy

What is the expected enhancement?

Currently, a BLAS implementation is needed Aer to build. However NumPy, which is a requirement, is already linked to a BLAS library. Under Anaconda, for example, this is the Intel MKL. It is possible to use this BLAS for Aer as well, a la Cython and the old qasm_simulator that used it.

Building Aer on OSX should not require XCode

What is the expected enhancement?

Building Aer on OSX requires having XCode installed. This is 6Gb of docs and other things that are not needed. It should be possible to build Aer using only the Apple command line tools, homebrew llvm, or homebrew gcc.

concurrent.futures.process.BrokenProcessPool

Informations

  • Qiskit Aer version: 0.1.1
  • Python version: 3.6
  • Operating system: Linux
  • Qiskit version: 0.8.0
  • Qiskit-terra: 0.7.1

What is the current behavior?

I'm having again the same problem presented here .
Basically, this is the exception

Traceback (most recent call last):
File "permutations_16.py", line 62, in <module> 
result = job.result()
File "/mnt/residential_zone/home/sperriello/virtual_envs/qiskit_beta/lib64/python3.6/site-packages/qiskit/providers/aer/aerjob.py", line 38, in _wrapper 
return func(self, *args, **kwargs)
File "/mnt/residential_zone/home/sperriello/virtual_envs/qiskit_beta/lib64/python3.6/site-packages/qiskit/providers/aer/aerjob.py",
line 95, in result return self._future.result(timeout=timeout)
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 432, in result 
return self.__get_result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

Steps to reproduce the problem

The program uses a total of 31 qubits on a server with 125GiB of RAM, with an Hadamard gate on 15 of them and just a controlled swap based on the previous Hadamard result on the other. I am using the statevector_simulator backend.
I also tried to reinstall qiskit-aer from the latest version through pip install git+https://github.com/Qiskit/qiskit-aer/, but I get a different problem related to a coupling map being none, so I returned to the stable version.

What is the expected behavior?

The program should run without problems.

OpenBLAS Warning flooding

Informations

  • Qiskit Aer version: 1.16.1
  • Python version: 3.5.4/3.6.7
  • Operating system: Linux Mint 18.3

What is the current behavior?

While running it in my local machine/HPC, I get multiple warnings for OpenBLAS Warning: Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option. How do I get rid of it? Does this warning affect my results/speed in any way?

UnboundLocalError occurs when thermal_relaxation is False in basic_device_noise_model

Informations

  • Qiskit AER version: 0.1.1
  • Operating system: Windows 10

What is the current behavior?

When I call qiskit.providers.aer.noise.device.basic_device_noise_model with thermal_relaxation=False, UnboundLocalError occurs.
It is because relax_params is defined only when thermal_relaxation=True.
See https://github.com/Qiskit/qiskit-aer/blob/master/qiskit/providers/aer/noise/device/models.py#L158

Steps to reproduce the problem

Run the following code.

from qiskit import IBMQ
from qiskit.providers.aer.noise.device.models import basic_device_noise_model

IBMQ.load_accounts()
properties = IBMQ.get_backend('ibmq_16_melbourne').properties()
basic_device_noise_model(properties, thermal_relaxation=False)

Get the following output.

C:\home\ima\envs\vqe2\lib\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 "a.py", line 6, in <module>
    basic_device_noise_model(properties, thermal_relaxation=False)
  File "C:\home\ima\envs\vqe2\lib\site-packages\qiskit\providers\aer\noise\device\models.py", line 104, in basic_device_noise_model
    standard_gates=standard_gates)
  File "C:\home\ima\envs\vqe2\lib\site-packages\qiskit\providers\aer\noise\device\models.py", line 185, in basic_device_gate_errors
    relax_params,
UnboundLocalError: local variable 'relax_params' referenced before assignment

What is the expected behavior?

No error occurs.

Suggested solutions

Initialize relax_params.
See #52

ImportError: DLL load failed: The specified module could not be found

Informations

qiskit 0.7.0
qiskit-aer 0.1.0
qiskit-terra 0.8.0
Windows 10

What is the current behavior?

When running this line:
from qiskit.providers.aer import noise
I got:
from qasm_controller_wrapper import qasm_controller_execute
ImportError: DLL load failed: The specified module could not be found.

There are additional error messages:
from .aerprovider import AerProvider
File "C:\Users\xyz\AppData\Local\Programs\Python\Python36\lib\site-packages\qiskit\providers\aer\aerprovider.py", line 15, in
from .backends.qasm_simulator import QasmSimulator
File "C:\Users\xyz\AppData\Local\Programs\Python\Python36\lib\site-packages\qiskit\providers\aer\backends_init_.py", line 10, in
from .qasm_simulator import QasmSimulator
File "C:\Users\xyz\AppData\Local\Programs\Python\Python36\lib\site-packages\qiskit\providers\aer\backends\qasm_simulator.py", line 16, in

Steps to reproduce the problem

Running this line:
from qiskit.providers.aer import noise

What is the expected behavior?

Suggested solutions

pip install qiskit-aer puts providers into qiskit meta-package

Informations

  • Qiskit Aer version: 0.1.1
  • Python version: 3.7
  • Operating system: OSX

Qiskit Terra: master

What is the current behavior?

pip install qiskit-aer is putting the Aer provider into the qiskit meta package and not into the terra providers module:

/miniconda3/lib/python3.7/site-packages/qiskit/providers/aer/*

So terra cannot find it:

ImportError: cannot import name 'Aer' from 'qiskit' (/miniconda3/lib/python3.7/site-packages/qiskit_terra-0.8.0-py3.7-macosx-10.7-x86_64.egg/qiskit/__init__.py)

Steps to reproduce the problem

What is the expected behavior?

Suggested solutions

Cannot build on Windows due to OpenMP

Informations

  • Qiskit AER version: 0.1.1
  • Operating system: Windows

What is the current behavior?

Windows builds, using VS2017 complain because the #pragmas for parallelizing for loops have different requirements than those for Linux/Mac. The variables showing in the loop need to be signed (e.g: int32_t instead of uint32_t)

Steps to reproduce the problem

Run a build.

What is the expected behavior?

Suggested solutions

As all of the loops involved are using the number of qubits for incrementing a variable, it's safe to move from uint32_t to int32_t.

Tensor network simulator backend

What is the expected enhancement?

This issue is to track development of the tensor network simulator (currently in MPS form). WIP PR will follow soon by @eladgoldman

Codebase

  • Fully interface with Qiskit - be a backend / provider

  • Implement all relevant base functions for simulator

  • Currently known bugs to fix: miscompares in special cases with Qasm simulator, some memory fails

  • Test suites

  • Runtime and memory performance profiling and optimizations

  • Documentation in code, readme, and tutorials/notebooks

  • Compilation files (make)

Benchmarking

  • Random circuits (including T's), parametrized by number of number of qubits, depth, and percentage of CXs

  • Structured circuits

  • Relevant benchmarks from the test library https://github.com/Qiskit/qiskit/tree/master/test/benchmarks

  • Aqua usecases

  • Find the qubit limit - currently we stopped at 23 for confidence reasons (needed to compare full statevectors to reference) but appears can go much higher when asking only for expectation values

Enhancements

  • Native interface for input observable(s) to get their expectation value at output

  • Native dealing with non-nearest-neighbors CX's (i.e., without hidden SWAPs). This is possible as long as no CX-cycles, so need to add SWAPs only when encountering cycles in input (today SWAPing on any non-nearest neighbor)

  • Consider possibilities to use incrementally - taking advantage of previous results on sub-circuit

  • Consider possibilities to parallelize (@hhorii we hope you could help here when the code matures)

installation of 0.1.1 from source code

BUG TEMPLATE

Informations

  • Qiskit AER version: 0.1.1
  • Operating system: CentOS 7.5.1804

What is the current behavior?

it crashed during the configuration when I try to build (python ./setup.py build) under my virtualenv

Steps to reproduce the problem

  1. install qiskit from source
    wget https://github.com/Qiskit/qiskit/archive/0.7.2.tar.gz
    tar xzvf 0.7.2.tar.gz
    pip ...

  2. uninstall qiskit-terra qiskit-aer

  3. pip install qiskit-terra/0.8.0 from source

  4. python ./setup.py build
    from source of aer

  5. the error message:
    CMake Error at CMakeLists.txt:13 (project):
    Running

    '/tmp/pip-build-env-w2x28op_/bin/ninja' '--version'

failed with:

No such file or directory

What is the expected behavior?

it installs correctly the package

Suggested solutions


FEATURE REQUEST TEMPLATE

What is the expected behavior?


ENHANCEMENT REQUEST TEMPLATE

What is the expected enhancement?

In the previous aer simulator we had a job.qobj

What is the expected behaviour?

In the previous simulator, we had a job.qobj. I know @ajavadia wanted this for the IBMQ. I am not sure we need this for simulators but I'm putting it here as I think we need to either add job.qobj here or remove job.qobj from basic. I don't mind which way we go but i would like the two simulators to have the same methods with aer having more not less.

qasm_simulator exits with 0 return code even when it errors

Informations

  • Qiskit Aer version:

Qiskit Aer: 0.1.1

  • Python version:

Python 3.6

  • Operating system:

Ubuntu 18.04

What is the current behavior?

When the qasm_simulator executable has an error it returns a 0 exit code, which traditionally means success.

Steps to reproduce the problem

Download and unzip the following test file (or any other file that causes a failure) -
fail.json.gz

run: ./qasm_simulator fail.json

echo $?

The return code will be 0, even though you'll get "success": false, and "status": "ERROR: ..."

What is the expected behavior?

exit code that is not 0

Suggested solutions

No module named 'qasm_controller_wrapper'

Informations

  • Qiskit AER version: 0.1.1
  • Operating system: ubuntu 18.04

What is the current behavior?

"from qiskit.providers.aer import noise" leads to the following:

ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from qiskit.providers.aer import noise

/usr/local/lib/python3.6/dist-packages/qiskit/providers/aer/init.py in
8 """Aer Backends."""
9
---> 10 from .aerprovider import AerProvider
11 from .aerjob import AerJob
12 from .aererror import AerError

/usr/local/lib/python3.6/dist-packages/qiskit/providers/aer/aerprovider.py in
13 from qiskit.providers.providerutils import filter_backends
14
---> 15 from .backends.qasm_simulator import QasmSimulator
16 from .backends.statevector_simulator import StatevectorSimulator
17 from .backends.unitary_simulator import UnitarySimulator

/usr/local/lib/python3.6/dist-packages/qiskit/providers/aer/backends/init.py in
8 """Aer Backends."""
9
---> 10 from .qasm_simulator import QasmSimulator
11 from .statevector_simulator import StatevectorSimulator
12 from .unitary_simulator import UnitarySimulator

/usr/local/lib/python3.6/dist-packages/qiskit/providers/aer/backends/qasm_simulator.py in
15 from qiskit.providers.models import BackendConfiguration
16 from .aerbackend import AerBackend
---> 17 from qasm_controller_wrapper import qasm_controller_execute
18 from ..aererror import AerError
19 from ..version import version

ModuleNotFoundError: No module named 'qasm_controller_wrapper'

There is no qiskit-aer 0.1.1 sdist tarball on pypi

Informations

  • Qiskit Aer version: 0.1.1
  • Python version: 3.X
  • Operating system: Any

What is the current behavior?

The qiskit-aer 0.1.1 package on pypi is missing the sdist. This prevents installing it on any environment where there is no published wheel file. Which includes non-x86 arches and OS combinations not covered by the wheel files on: https://pypi.org/project/qiskit-aer/#files

Steps to reproduce the problem

Try running pip install qiskit-aer==0.1.1 on a system where there is no wheel file published.

What is the expected behavior?

It will download the sdist and build aer for the system.

Suggested solutions

Upload an sdist file for 0.1.1 (as was done in the 0.1.0 release).

Cannot import Aer

Informations

  • Qiskit AER version: 0.1
  • Operating system: Windows 10

Before raising an issue here I've asked Stack Overflow:
https://stackoverflow.com/questions/53929599/cannot-import-aer-from-qiskit-0-7

What is the current behavior?

In Python interpreter, typing from qiskit import Aer raises an ImportError.

Steps to reproduce the problem

-Install Python 3
-Set up a new virtual environment: python -m venv C:\myenv
-activate this environment and pip install qiskit
-run python interpreter
-from qiskit import Aer

It also appears that doing the same on Ubuntu doesn't cause any problems

What is the expected behavior?

Expected that it would import

Suggested solutions

Pass user specified directories to the build system

Informations

  • Qiskit AER version: 0.1
  • Operating system: OSX

What is the current behavior?

The make system does not find the OpenBLAS libraries in their default location in OSX. Instead, the Apple Accelerate libs are always used.

Steps to reproduce the problem

What is the expected behavior?

The installer should find the OpenBLAS libs if they are installed in the default dirs.

Suggested solutions

BasicAer: order of registers in circuit can change behavior

Informations

  • Qiskit Aer version: 0.1.1
  • Python version: 3.7.1
  • Operating system: Windows 10

What is the current behavior?

Using BasicAer qasm_simulator, the behavior of a circuit changes depending on the order in which quantum registers are added to the circuit.

Steps to reproduce the problem

  • Qiskit Terra version: 0.7.0
  • Qiskit version: 0.7.3

from qiskit import QuantumRegister,ClassicalRegister,QuantumCircuit
from qiskit import BasicAer,execute
from qiskit.tools.visualization import plot_histogram

q = QuantumRegister(2, 'cntl')
qout = QuantumRegister(1, 'tgt')
c = ClassicalRegister(1, 'c')
qc = QuantumCircuit(qout, q, c) # here's where we create the circuit

qc.h(q[0]) # Toffoli gate with two |+> inputs
qc.h(q[1])
qc.ccx(q[0],q[1],qout[0])
qc.measure(qout,c)
backend = BasicAer.get_backend('qasm_simulator')
job = execute(qc, backend, shots=512)
result = job.result()
print(result.get_counts()) # produces expected outcome -- 75% zero and 25% one

q2 = QuantumRegister(2, 'cntl') # now we do the same thing, but create the circuit differently
qout2 = QuantumRegister(1, 'tgt')
c2 = ClassicalRegister(1)
qc2 = QuantumRegister(q2, qout2, c2) # just changed the order of q and qout

qc2.h(q2[0]) # Toffoli gate with two |+> inputs
qc2.h(q2[1])
qc2.ccx(q2[0],q2[1],qout2[0])
qc2.measure(qout2,c2)
backend = BasicAer.get_backend('qasm_simulator')
job = execute(qc2, backend, shots=512)
result = job.result()
print(result.get_counts()) # result is 100% zero

What is the expected behavior?

The output should be the same in both cases. I see the expected behavior when using the Aer provider, and when running on hardware.

Suggested solutions

Support Debian distribution in the wheel package

Informations

  • Qiskit AER version: 0.1.1
  • Operating system: Debian

What is the current behavior?

Debian install Python stuff in dist-package directory, instead of site-packages, so our current wheels installation doesn't work on these distros.

Steps to reproduce the problem

Install Qiskit
Try to import Aer:

from qiskit import Aer

This will fail.

What is the expected behavior?

We would love to support as many Linux distros as possible.

Suggested solutions

python setup.py build Error

Informations

  • Qiskit Aer version:
  • Python version 3.6.4:
  • Operating system RHEL 6.4:

What is the current behavior?

I want to compile the cpp_simulator.
Now, I want to execute:
python setup.py build
and get the error:
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /opt/xsite/cte/tools/python/3.6.4/lib/libpython3.6m.a(getcopyright.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

Steps to reproduce the problem

I have build cmake, OpenBlas and Boost. After that, I have tried to execute:
python setup.py build

Raise an error if noise is attached to a non-existing gate

What is the expected enhancement?

Running the simulator with a noise model which consists of the following single error:

noise_model.add_all_qubit_quantum_error(depolarizing_error(0.002, 2), 'bla')

Currently the simulator succeeds. Of course no noise occurs.
I think it would be better to raise an error, accompanied by a message: attempt to attach noise to gate 'bla', but gate 'bla' does not exist.

Error with OpenMP

Informations

  • Qiskit AER version:
    qiskit 0.1
  • Operating system:
    MacOS

What is the current behavior?

Running the tutorials gives the following error

OMP: Error #15: Initializing libiomp5.dylib, but found libomp.a already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.

Steps to reproduce the problem

What is the expected behavior?

No error

Suggested solutions

Add Qiskit AER homepage URL to the setup.py

What is the expected enhancement?

As we do in other Qiskit-related packages, like Terra (see below), we should provide the URL of the Qiskit AER homepage in the setup.py. That URL is shown as part of the installation info and in other dependencies-related tools. In this sense, we are using the GitHub repo URL as the homepage for all the Qiskit packages.

This is what pip show qiskit-terra looks like:
screen shot 2019-01-29 at 13 39 46

And this is what pip show qiskit-aer looks like:
screen shot 2019-01-29 at 13 39 52

Parsing a qobj with bfunc raises an error

Informations

  • Qiskit AER version: 0.1.1
  • Operating system: MacOS

What is the current behavior?

In testing Qiskit/qiskit#1778 with the Aer provider, submitting a conditional circuit with a qobj-compliant conditional raises a AerBackend: simulation failed error from

qobj.load_qobj_from_json(qobj_js);
. Printing out the exception yields:

{'job_id': None,
'date': None,
'backend_name': None,
'qobj_id': None,
'status': 'ERROR: Failed to load qobj: [json.exception.type_error.302] type must be array, but is number',
'backend_version': None,
'success': False}

Steps to reproduce the problem

Checkout Qiskit/qiskit#1778 and run any conditional circuit. e.g.

qr = qk.QuantumRegister(2)
cr1 = qk.ClassicalRegister(1)
cr2 = qk.ClassicalRegister(1)
qc = qk.QuantumCircuit(qr, cr1, cr2)

qc.h(qr[0])
qc.measure(qr[0],cr1)
qc.x(qr[1]).c_if(cr1, 1)
qc.measure(qr[1],cr2)

The resulting qobj

{'config': {'memory_slots': 2, 'n_qubits': 2},
 'experiments': [{'config': {'memory_slots': 2, 'n_qubits': 2},
                  'header': {'clbit_labels': [['c0', 0], ['c1', 0]],
                             'creg_sizes': [['c0', 1], ['c1', 1]],
                             'memory_slots': 2,
                             'n_qubits': 2,
                             'name': 'circuit0',
                             'qreg_sizes': [['q0', 2]],
                             'qubit_labels': [['q0', 0], ['q0', 1]]},
                  'instructions': [{'name': 'h', 'qubits': [0]},
                                   {'memory': [0],
                                    'name': 'measure',
                                    'qubits': [0],
                                    'register': [0]},
                                   {'mask': '0x1',
                                    'name': 'bfunc',
                                    'register': 2,
                                    'relation': '==',
                                    'val': '0x1'},
                                   {'conditional': 2,
                                    'name': 'x',
                                    'qubits': [1]},
                                   {'memory': [1],
                                    'name': 'measure',
                                    'qubits': [1],
                                    'register': [1]}]}],
 'header': {},
 'qobj_id': '94b4fbcc-e12e-47bc-898c-4106b4686867',
 'schema_version': '1.0.0',
 'type': 'QASM'}

contains a bfunc with register: 2, which is causing the JSON parser to throw.

What is the expected behavior?

It looks like the JSON->op parser ( https://github.com/Qiskit/qiskit-aer/blob/master/src/framework/operations.hpp#L474 ) expects memory and register to be arrays ( https://github.com/Qiskit/qiskit-aer/blob/master/src/framework/operations.hpp#L38 ) but in the qobj-spec, bfunc instructions are a special case where they are singleton integers.

Suggested solutions

qisikit-aer-0.1.1 can't be found by pip

Informations

  • Qiskit Aer version: 0.1.1
  • Python version: 3.6.8
  • Operating system: IBM i

What is the current behavior?

$ pip install qiskit-aer==0.1.1
Collecting qiskit-aer==0.1.1
  Could not find a version that satisfies the requirement qiskit-aer==0.1.1 (from versions: 0.1.0)
No matching distribution found for qiskit-aer==0.1.1

Steps to reproduce the problem

pip install qiskit

What is the expected behavior?

Installation of qiskit 0.8.0 should install qiskit-aer 0.1.1.

Suggested solutions

Find out what got broken at PyPi.

CH simulator sometimes segment faults for circuit with u1 gate

Informations

  • Qiskit Aer version: master
  • Python version: 3.6
  • Operating system: MacOS 10.14.3

What is the current behavior?

@padraic-padraic this may be related to issue #98, or something different. While trying to debug that issue with Sergey I found that the CH simulator will cause a segmentation fault sometimes for circuits for a test circuit with a u1 gate in it.

Steps to reproduce the problem

Run the following script, at a random point in the iteration loop it may crash with a segmentation fault (though not always).

from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute
from qiskit.providers.aer import QasmSimulator
import numpy as np

qr = QuantumRegister(2, 'qr')
cr = ClassicalRegister(2, 'cr')
circ = QuantumCircuit(qr, cr)
circ.h(qr[0])
circ.cx(qr[0], qr[1])
circ.u1(np.pi / 100, qr[0])
circ.measure(qr, cr)

for j in range(100):
    result = execute(circ, QasmSimulator(), backend_options={"method": "ch"}).result()
    print("Execution {}:".format(j), result.get_counts(circ))

It also returns the incorrect output (same as #98 )

What is the expected behaviour?

The execution doesn't cause a segmentation fault.

Suggested solutions

None yet.

concurrent.futures.process.BrokenProcessPool

original issue from @tigerjack: Qiskit/qiskit#1590

Informations

  • Qiskit Terra version: 0.7.0
  • Python version: 3.7.1
  • Operating system: ArchLinux

What is the current behavior?

I got an exception on two different machines, but I'm not sure if it's related to qiskit-terra or python itself. The exception arise when I invoke the job.result() method.

File "/home/simone/LinuxData/virtualenvs/qiskit_env/lib/python3.7/site-packages/qiskit/providers/aer/aerjob.py", line 39, in _wrapper
return func(self, *args, **kwargs)
File "/home/simone/LinuxData/virtualenvs/qiskit_env/lib/python3.7/site-packages/qiskit/providers/aer/aerjob.py", line 98, in result
return self._future.result(timeout=timeout)
File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib64/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

I found other similar issue which suggested to use the if __name__ == "__main__": statement, but this is already there: the whole program code is under this statement.

Steps to reproduce the problem

The problem appears randomly when I run my qiskit program. It's a huge project, and sometimes the program works seamlessly, while others fail with this message.

What is the expected behavior?

The program should always run without problems.

SchemaValidationError using statevector_simulator on an empty circuit

Informations

  • Qiskit Aer version: 0.1.1
  • Python version: Python 3.7.2 (Anaconda)
  • Operating system: macOS 10.14.4

What is the current behavior?

I get a SchemaValidationError

qiskit.qobj._schema_validation._SummaryValidationError: 'Original message too long to be useful: {\'qobj_id\': \'db850989-a583-4578-a0d6-8b4b275af261\', \'config\': {\'shots\': 1024, \'memory_slots\': 0, \'max_credits\': 10, \'memory\': False, \'n_qubits\': 1}, \'experiments\': [{\'instructions\': [], \'header\': {\'n_qubits\': 1, \'memory_slots\': 0, \'qubit_labels\': [[\'q0\', 0]], \'clbit_labels\': [], \'qreg_sizes\': [[\'q0\', 1]], \'creg_sizes\': [], \'name\': \'circuit0\', \'compiled_circuit_qasm\': \'OPENQASM 2.0;\\ninclude "qelib1.inc";\\nqreg q0[1];\\n\'}, \'config\': {\'memory_slots\': 0, \'n_qubits\': 1}}], \'header\': {\'backend_name\': \'statevector_simulator\'}, \'type\': \'QASM\', \'schema_version\': \'1.0.0\'} is not valid under any of the given schemas\n\nFailed validating \'oneOf\' in schema:\n    {\'$schema\': \'http://json-schema.org/draft-04/schema#\',\n     \'definitions\': {\'bfunc\': {\'properties\': {\'mask\': {\'type\': \'string\'},\n                                              \'memory\': {\'minimum\': 0,\n                                                         \'type\': \'integer\'},\n                                              \'name\': {\'enum\': [\'bf[...]'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "initialize_bug.py", line 9, in <module>
    job_sim = execute(qc, backend)
  File "~/envs/quantum/lib/python3.7/site-packages/qiskit/tools/compiler.py", line 110, in execute
    return backend.run(qobj, **kwargs)
  File "~/envs/quantum/lib/python3.7/site-packages/qiskit/providers/aer/backends/aerbackend.py", line 80, in run
    aer_job.submit()
  File "~/envs/quantum/lib/python3.7/site-packages/qiskit/providers/aer/aerjob.py", line 73, in submit
    validate_qobj_against_schema(self._qobj)
  File "~/envs/quantum/lib/python3.7/site-packages/qiskit/qobj/_validation.py", line 23, in validate_qobj_against_schema
    err_msg='Qobj failed validation. '
  File "~/envs/quantum/lib/python3.7/site-packages/qiskit/qobj/_schema_validation.py", line 148, in validate_json_against_schema
    raise newerr
qiskit.qobj._schema_validation.SchemaValidationError: 'Qobj failed validation. Set Qiskit log level to DEBUG for further information.'

Steps to reproduce the problem

from qiskit import QuantumCircuit, QuantumRegister, execute
from qiskit.providers.aer import Aer

backend = Aer.get_backend('statevector_simulator')

q = QuantumRegister(1)
qc = QuantumCircuit(q)

job_sim = execute(qc, backend)
print(job_sim.result().get_statevector())

What is the expected behavior?

[1.+0.j 0.+0.j]

Suggested solutions

Density matrix simulator

We need a density matrix simulator to perform noisy simulations of experiments for small-size systems.

Add initialise simulator instruction to to statevector_state

What is the expected behavior?

Add Aer support for an explicit initialize instruction to the Statevector State class for use in the StatevectorSimulator and QasmSimulator to work with the Terra PR 1896.

The qobj instruction for initialize should be something like:

{"name": "initialize", "qubits": list[int], "params": complex_vector}

And should act to reset all qubits in the "qubits" field to the zero state (to remove any entanglement with other qubits in the system), and then set the statevector for those qubits to the vector in "params".

If the system is already in the zero-state or all qubits are being initialize the reset operations could be skipped and the state set directly.

Example

Example:

Consider a 2-qubit circuit, where I want to initialize qubit-0 to the |1> state, and qubit-3 to the |+> state:

Reset [0, 3]

state is psi3 \otimes psi0

[{"name": "initialize", "qubits": [0, 3],
  "params": [[0, 0], [0.70710678, 0], [0, 0], [0.70710678, 0]]}]

Reset [3, 0]

state is psi0 \otimes psi3

[{"name": "initialize", "qubits": [3, 0],
  "params": [[0, 0], [0, 0], [0.70710678, 0, 0], [0.70710678, 0]]}]

Reset [0], Reset [3]

[{"name": "initialize", "qubits": [0], "params": [[0, 0], [1, 0]]},
 {"name": "initialize", "qubits": [3], "params": [[0.70710678, 0], [0.70710678, 0]]}]

Python wheels from PyPi don't work with Miniconda 3 and Python 3.7 on Windows.

Informations

  • Qiskit Aer version: pypi packages
  • Python version: 3.7
  • Operating system: Windows

What is the current behavior?

Seems like the packages we are distributing via PyPi don't work as expected on Minicionda3 AND Python 3.7
Everything seems to be working with Python 3.5 and 3.6

Steps to reproduce the problem

  1. pip install qiskit
  2. launch python interpreter in version 3.7
  3. from qiskit.proivders.aer import Aer
  • That should error complaining about not loading a DLL.

What is the expected behavior?

Suggested solutions

We are abusing of 64 bits unsinged variables

Informations

  • Qiskit Aer version: 0.1.1
  • Python version: Doesn't apply
  • Operating system: All

What is the current behavior?

I'm treating this as a bug, because while I was trying to make our code compatible with OpenMP 2 (unfortunate Windows constraints), I saw that we are abusing of uint64_t (and it's variants) types.
Event though modern 64 bits processors can handle 64 bits without any penalty, there's an extra amount of memory we are wasting because of this, and because we need to be compatible with OpenMP 2, so we can't use unsigned type variables in the for loops being parallelized, I'd recommend thinking very carefully whether our data structures require to be 64 bit unsigned or not.

For now, there are some dangerous conversions from uint64_t to unsigned (which is promoted to a uint32_t) that we have to fix.

I saw this code in the new CH simulator, but we have to review all the codebase.
Fortunately, the compiler warns about this situation, so it's easy to detect and fix.

This seems to be a good candidate for an introductory issue, and get used to our workflow, so if there's any intrepid contributor who wants to takeover this issue, I'll mentor!

What is the expected behavior?

There should be now warnings about suspicious implicit castings, with possible lost of data.

Suggested solutions

Move unsigned index variables to signed and manually convert back from signed to a temporary unsinged that will be finally used as the index, but only in loops being parallelized with OpenMP:
For example:

#pragma omp parallel for
    for(unt_t i=0; i<dim; i++){  // <--- This is not allowed per OpenMP 2 
         vector[i] = ...

Fix:

#include <limits>

#pragma omp parallel for
for(int_t i =  std::numeric_limits<int_t>::min(); i < dim; i++){
     vector[from_signed_to_unsigned(i)] = ...

The free function:

template<typename unsigned_type, typename signed_type>
unsigned_type from_signed_to_unsigned( signed_type i );

... should transform a negative number to it's corresponding positive number, for example:

std::cout << from_signed_to_unsigned<uint_t, int_t>(std::numeric_limits<int_t>::min());

... should print: 0.

Aer installation fails in multiple cases

Informations

  • Qiskit AER version: 0.1
  • Operating system: Multiple/unknown

What is the current behavior?

Error when importing Aer in trinket and Google Colab.

I've also seen people have the problems on Windows. I suggested installation from source, but they had no desire to take that step.

Steps to reproduce the problem

See the above links.

What is the expected behavior?

Aer should be importable.

Buid break in CH Simulator

Informations

  • Qiskit Aer version: 72863e8
  • Python version:
  • Operating system: macOS

What is the current behavior?

In some build environment, json_t is not converted to std::string.

serialized_states[i] = serialize_state(i);

qiskit-aer/src/third-party/headers/nlohmann_json.hpp:1201:9: error: static_assert failed "could not find from_json() method in T's namespace" [clang-diagnostic-error]
        static_assert(sizeof(BasicJsonType) == 0,
        ^
qiskit-aer/src/third-party/headers/nlohmann_json.hpp:1216:16: note: in instantiation of function template specialization 'nlohmann::detail::from_json_fn::call<nlohmann::basic_json<std::map, std::vector, std::__1::basic_string<char>, bool, long long, unsigned long long, double, std::allocator, adl_serializer>, std::__1::basic_string_view<char, std::__1::char_traits<char> > >' requested here
        return call(j, val, priority_tag<1> {});
               ^
qiskit-aer/src/third-party/headers/nlohmann_json.hpp:9669:9: note: in instantiation of function template specialization 'nlohmann::detail::from_json_fn::operator()<nlohmann::basic_json<std::map, std::vector, std::__1::basic_string<char>, bool, long long, unsigned long long, double, std::allocator, adl_serializer>, std::__1::basic_string_view<char, std::__1::char_traits<char> > >' requested here
        ::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
        ^
qiskit-aer/src/third-party/headers/nlohmann_json.hpp:12094:36: note: in instantiation of function template specialization 'nlohmann::adl_serializer<std::__1::basic_string_view<char, std::__1::char_traits<char> >, void>::from_json<const nlohmann::basic_json<std::map, std::vector, std::__1::basic_string<char>, bool, long long, unsigned long long, double, std::allocator, adl_serializer> &, std::__1::basic_string_view<char, std::__1::char_traits<char> > >' requested here
        JSONSerializer<ValueType>::from_json(*this, ret);
                                   ^
qiskit-aer/src/third-party/headers/nlohmann_json.hpp:12355:16: note: in instantiation of function template specialization 'nlohmann::basic_json<std::map, std::vector, std::__1::basic_string<char>, bool, long long, unsigned long long, double, std::allocator, adl_serializer>::get<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::basic_string_view<char, std::__1::char_traits<char> >, 0>' requested here
        return get<ValueType>();
               ^
/usr/local/Cellar/llvm/7.0.0/bin/../include/c++/v1/string:875:29: note: in instantiation of function template specialization 'nlohmann::basic_json<std::map, std::vector, std::__1::basic_string<char>, bool, long long, unsigned long long, double, std::allocator, adl_serializer>::operator basic_string_view<std::__1::basic_string_view<char, std::__1::char_traits<char> >, 0>' requested here
        {__self_view __sv = __t; return assign(__sv);}
                            ^
qiskit-aer/src/simulators/ch/ch_runner.hpp:615:26: note: in instantiation of function template specialization 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=<nlohmann::basic_json<std::map, std::vector, std::__1::basic_string<char>, bool, long long, unsigned long long, double, std::allocator, adl_serializer>, void>' requested here
    serialized_states[i] = serialize_state(i);
                         ^

Steps to reproduce the problem

Build standalone.

mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=g++-8 ..
make

What is the expected behavior?

Build finishes without errors.

Suggested solutions

serialized_states[i] = serialize_state(i).dump();

A crash when running from Jupyter Notebook

Informations

  • Qiskit AER version: stable
  • Operating system: Linux

What is the current behavior?

I get a crash when I run the simulator from Jupyter notebook, with an error message that I don't understand. The same code runs alright outside of Jupyter notebook.

Steps to reproduce the problem

Someone else has already encountered the same and provided an accurate description: https://stackoverflow.com/questions/50611414/jupyter-notebook-always-gives-brokenprocesspool-error-while-executing-qiskit-cod

What is the expected behavior?

Do not crash, or at least crash with a meaningful message.

Suggested solutions

Get version information in the Standalone build

What is the expected enhancement?

We want to know what version are we using in the standalone simulator via: qasm_simulator -v
Only the version number information will be shown for now:

Qiskit Aer: 0.1.1

Evaluate building Windows wheel package statically

Distributing a wheel package with an executable/library statically linked makes things easier for our users as they don't need to install external dependencies. It has it's drawbacks as well but in general, and for our specific use case the balance tilts towards static linking.
On Windows platforms, we are not building statically yet, so this is issue is to track this progress.

If I found any stopper to not building statically, I'd document it here.

Redesign how backend configuration is loaded

What is the expected behavior?

Since we have to pass an important configuration parameter (runtime path) to the MacOS simulator, I have noticed that we have to explicitly call the controller::set_config( qobj["config"] ) function before calling execute. The thing is that execute already takes the qobj (so the qobj["config"]) as a parameter, so there's no virtual need for calling controller::set_config() explicitly.
We need to redesign how configuration is loaded in the simulators, having simplicity for the user in mind (he should not call any function if it's not strictly necessary).

Aer backends do not have a coupling_map

Informations

  • Qiskit Aer version: master
  • Python version:
  • Operating system:

What is the current behavior?

According to the spec "Qiskit Backend Specifications for OpenQASM and OpenPulse Experiments", all backends are required to have a coupling_map in their backend.configuration(). The Aer backends do not.

Steps to reproduce the problem

What is the expected behavior?

Suggested solutions

make does not respect choice of compiler on OSX

Informations

  • Qiskit AER version: 0.1
  • Operating system: OSX

What is the current behavior?

The make system used for Aer defaults to the compilers in XCode (See #20) even if the choice of compiler is overridden via path modification or aliasing.

Steps to reproduce the problem

What is the expected behavior?

It should be possible to select which compiler is used to build Aer.

Suggested solutions

Enhance local testing workflow

Due to our directory structure, and our dependency with Qiskit-Terra, we have a far from ideal testing workflow, which is very error-prone and confusing many times.
We have to figure out a way to improve this situation and make testing seamless again.

pip installation fail with compilation

Informations

  • Qiskit Aer version: 0.1.0
  • Python version: 3.6
  • Operating system: Ubuntu 16.04

What is the current behavior?

pip install qiskit-aer --no-binary :all: does not install qiskit-aer.

Steps to reproduce the problem

  1. Install Python 3.6 and pip3
$ apt-get install software-properties-common -y
$ apt-get install python3.6 python3.6-dev wget -y
$ wget https://bootstrap.pypa.io/get-pip.py
$ python3.6 get-pip.py
  1. Install the latest cmake.
wget https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4.tar.gz
cd cmake-3.13.4
./configure
make
make install
  1. Install scikit-build, cmake, and cython modules.
pip3 install scikit-build -y
pip3 install cmake cython -y
  1. Install qiskit
pip3 install qiskit
  1. Re-install qiskit-aer without wheel files
pip3 uninstall qiskit-aer
pip3 install qiskit-aer --no-binary :all:

What is the expected behavior?

qiskit-aer is installed correctly.

Suggested solutions

Cannot build Aer without OpenMP

Informations

  • Qiskit AER version: 0.1
  • Operating system: OSX

What is the current behavior?

One cannot build the Aer simulator without OpenMP (on vanilla osx, for example) because the variable 'num_threads_circuit' is only defined inside and omp ifdef section, but used outside.

Steps to reproduce the problem

What is the expected behavior?

Suggested solutions

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.