Questions tagged [qiskit]

Quantum computing framework for writing programs and applications

Qiskit is an open-source software development kit (SDK) for working with quantum computers at the level of circuits, pulses, and algorithms.

237 questions
6
votes
1 answer

Can I change the byte ordering from little endian to big endian in qiskit?

The regular Matrix representation of a CNOT gate as found in literature is: CNOT = \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end{bmatrix} However in…
6
votes
3 answers

Can´t import qiskit, attribute error in numpy: " 'numpy.random' has no attribute 'default_rng'"

I´m using Python 3 and I´m working in jupyter, when I try to import qiskit the following error is showed: --------------------------------------------------------------------------- AttributeError Traceback (most recent…
Abner
  • 71
  • 1
  • 1
  • 6
6
votes
2 answers

Qiskit Transpiler for quantum circuits

Okay, so, in Qiskit there is the transpile() function (see documentation). My understanding of a transpiler is best described as a way of converting one set of gate operations to another set of gate operations, with the intent of running an…
5
votes
2 answers

The class MatplotlibDrawer needs pylatexenc. to install, run "pip install pylatexenc"

I am using colab for qiskit and even after installing pylatexenc using pip this still comes as an error, I also used !pip.Here's the full pic
Ankit_cnarte
  • 51
  • 1
  • 2
5
votes
2 answers

How to create unitary gate from np.array in qiskit?

Hi all: Cirq offers a way to create a unitary gate from an array. I tried doing the same in Qiskit but have not been able to quite make it. Here is a sample code with what I could put together so far. Also, is there a way to apply the controlled…
Vox
  • 173
  • 1
  • 8
4
votes
1 answer

pip install qiskit errors

So I'm trying to get qiskit to work on my system (arch linux) but I'm having trouble installing qiskit, specifically qiskit-aer. I've seen several other posts with similar issues suggesting that I downgrade python. To do this I'm using pyenv running…
4
votes
2 answers

Getting 'Figure(..x..)' when drawing quantum circuit with qiskit “mpl” output mode

I am just starting with Quantum Computing and I tried the following code. from qiskit import * qr = QuantumRegister(2) cr = ClassicalRegister(2) Qc = QuantumCircuit(qr,cr) print ('This is the initial state') print(Qc.draw(output = 'mpl')) print…
4
votes
1 answer

The Universtal Gate U(theta, phi, lamda) in Open QASM vs Qiskit

I have noticed that Open QASM and Qiskit define the universal single-qubit gate U(lambda, theta, phi) differently. The difference causes a phase difference in RZ, for example. Has anyone come across this problem? Which should one choose?
4
votes
2 answers

Visualizing circuits in qiskit with matplotlib

I'm learning how to use qiskit and I'm using the jupyter notebook, but everytime I try to visualize the circuit with the attribute draw I get this error: import qiskit from qiskit import * from qiskit import IBMQ qr = QuantumRegister(2) cr =…
SAR_90
  • 71
  • 7
4
votes
1 answer

How to create a new quantum gate and qubit initialised to a certain value

I am trying to implement the Quantum HHL algorithm on QISKit package of IBM on Python. I have tried searching the documentation for a method to initialize a qubit to a certain value and to create a new unitary gate with specified values. In the…
3
votes
1 answer

AttributeError: 'QuantumCircuit' object has no attribute 'config'

I am working on a program for Qiskit, but I am getting a strange error (one that I have not gotten in the past) when I try to simulate a circuit. Here is a minimal example producing the error: from qiskit.circuit import QuantumCircuit from qiskit…
Owen D
  • 55
  • 5
3
votes
1 answer

Quantum Programming . . . How?

So I understand some of the basic ideas with setting up a quantum program . . . libraries, classical logic feeding to a quantum API, all that. I even get that there are quantum operations you apply. Where I am struggling is how do you figure out…
ThatCampbellKid
  • 561
  • 1
  • 5
  • 19
3
votes
1 answer

Is there any systematic way to decompose a two-level unitary matrix into single-qubit and CNOT operations?

I would like to make a quantum circuit from the following matrix. matrix to be transformed into qubit operations How can I decompose this matrix into qubit operations such as Rotation Y, Control-NOT and so on ? FYI, I read a book named "Quantum…
Ashy
  • 179
  • 5
3
votes
1 answer

How to make a gate which generates |0> or |1> based on a parameter?

I would like to make a single-qubit gate which gives |0> or |1> with reference to a parameter. For example, I set a parameter theta in range of 0 to 2π. When theta is in range of 0 to π, the gate returns |0> and when theta is in range of π to 2π,…
Ashy
  • 179
  • 5
3
votes
5 answers

Cannot import Aer from Qiskit 0.7

I've created a new virtual environment in Anaconda and installed several packages using pip (namely, numpy, scipy, matplotlib, qiskit and maybe 1 or 2 more). I open the interpreter and try to import a module from Qiskit: from qiskit import Aer As a…
Alexey Uvarov
  • 145
  • 2
  • 7
1
2 3
15 16