Questions tagged [qiskit]

Quantum computing framework for writing programs and applications

Qiskit is a quantum computing framework for writing programs and applications, and performing quantum experiments.

120 questions
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
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…
3
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
  • 143
  • 8
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
  • 513
  • 1
  • 4
  • 16
3
votes
4 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
  • 143
  • 1
  • 7
3
votes
1 answer

Install qiskit on MacOS HighSierra Error: No such file or directory: 'qiskit.egg-info'

I was trying to install QISKit via the pip method as mentioned on their webpage. However, after many trials, this method doesn't seem to work and I am getting the following error on the terminal. Compiling QISKit C++ Simulator creating out …
2
votes
2 answers

QISKIT error - numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

I ran this from qiskit import QuantumCircuit, execute, Aer from qiskit.visualization import plot_histogram and got the below error --------------------------------------------------------------------------- ValueError …
X10nD
  • 19,972
  • 44
  • 105
  • 150
2
votes
0 answers

The Tutorials in Qiskit: Option Pricing with qGANs

# Set upper and lower data values bounds = np.array([0.,7.]) # Set number of qubits used in the uncertainty model num_qubits = [3] # Set entangler map entangler_map = [] for i in range(sum(num_qubits)): entangler_map.append([i, int(np.mod(i+1,…
LOGA
  • 21
  • 1
2
votes
1 answer

Unexpected keyword argument 'datatime' qiskit provider

I'm trying to set datatime calling backend.properties qiskit. this is my code : from qiskit import * from qiskit.providers.ibmq import * provider = IBMQ.get_provider(hub='ibm-q') provider.backends(simulator=False) backend =…
2
votes
0 answers

Quantum amplitude encoding

I would like to perform the Quantum Fourier Transform (QFT) of a sequence of, say, 8 elements. I have then the problem of encoding the sequence of 8 elements into 3 qubits. My question is how performing this task with Qiskit. I would say that one…
Vitality
  • 18,557
  • 4
  • 87
  • 129
2
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
  • 159
  • 5
2
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
  • 159
  • 5
2
votes
1 answer

How to call EnergyInput() function in Qiskit python?

I want to implement SVM with Qiskit. I used this following code. from qiskit import Aer from qiskit.aqua.utils import split_dataset_to_data_and_labels from qiskit.aqua.input import get_input_instance from qiskit.aqua import run_algorithm n =…
Protik Nag
  • 411
  • 4
  • 14
2
votes
1 answer

Unable to find module qiskit_aqua.algorithms

pip-install qiskit-aqua completed successfully. Following is ths stack trace: ModuleNotFoundError Traceback (most recent call last) in () 2 import sys 3 from datasets import…
Abhishek
  • 23
  • 3
1
vote
1 answer

Qiskit Nature VQE print full quantum circuit

I am doing VQE using Qiskit Nature. I want to see how my final quantum circuit looks like. How to print the whole quantum circuit (like an ansatz)?
Farida
  • 11
  • 2
1
2 3 4 5 6 7 8