Questions tagged [qiskit]
Quantum computing framework for writing programs and applications
92
questions
-1
votes
0answers
20 views
Guidance for a Travelling Salesman Problem
So i've been working on a react-python(flask) app that uses mapbox-gl for users to input way points on a Map UI. The flask application should takes in those lng/lat coords and create a atsp file. ...
0
votes
1answer
29 views
qbit collapse before Quantum Teleportation
I have been tweaking with quantum teleportation in python qiskit. One extra thing that I have done in the following diagram is the measurement of q330 at the very beggining.
I am doing this because I ...
0
votes
0answers
20 views
How to plot state_vector or probability histogram of single qubit in a multi-qubit circuit in Qiskit?
How can I get statevector and/or blochsphere representation of qubits of my choice. For example I have 3 qubits with different gates being applied on each qubit. the qiskit state_vector simulator ...
0
votes
1answer
23 views
Jupyter Notebook failed command in Anaconda Prompt for Qiskit
I have Qiskit installed via Anaconda and a virtual environment set up in Python 3.8. when I run (.venv) C:\Users\brenm>jupyter notebook (in Anaconda prompt) it fails and throws 'jupyter' is not ...
0
votes
1answer
23 views
Jupyter Notebook command failing in Qiskit
I have Qiskit installed via Anaconda and a virtual environment set up in Python 3.8. When I run the command jupyter notebook in the Anaconda prompt I get an error. I'm not sure what the problem is. ...
1
vote
1answer
63 views
Failed Qiskit installation with Anaconda on Windows
I'm attempting to install Qiskit via pip and Anaconda on my machine. Here's my process
1.) Install Anaconda
2.) Open Anaconda 3 prompt
3.) Create a virtual environment using conda create -n <...
0
votes
0answers
20 views
Why is the 00 state in phase pi but the output of the state at 00 in the state vector is not negative?
I am running qiskit and i get the following. Why is the 00 state in phase pi but the output of the state at 00 in the state vector is not negative?:
0
votes
1answer
30 views
Is CSP Layout always the first algorithm used by qiskit transpiler to map quantum circuit?
I'm using Qiskit transpile with optimization_level=3. I was wondering if CSP layout selector is always the first algorithm tried by Qiskit, also if I set as layout_method='noise_adaptive' or other ...
0
votes
0answers
39 views
IBM Quantum computer code keeps running job after job
I'm using qiskit for my University research project but whenever I send a job to run on IBM's Quantum experience, it'll wait in the queue, run, obtain results (in the form of a histogram) but instead ...
0
votes
0answers
38 views
Usage of Tensorflow to train Qiskit circuits
In order to explore whether it is possible to train a Qiskit Quantum circuit with tensorflow I built a small toy model.
The purpose of this toy model is to find via tensorflow the correct angle to get ...
0
votes
1answer
104 views
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 ...
0
votes
0answers
26 views
Is a 0.0 loss rate on a Hybrid Quantum-Classical RNN possible?
I've been playing around with the hybrid quantum-classical RNN on the qiskit notebook using IBM Quantum Experience, and I managed to get a loss rate of 0.0001, however no more decimal places are ...
1
vote
2answers
344 views
The class MatplotlibDrawer needs pylatexenc. to install, run “pip install pylatexenc” [closed]
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
0
votes
0answers
42 views
How to get the Qiskit textbook widgets working?
For example, when trying to run
from qiskit_textbook.widgets import gate_demo
gate_demo(gates='pauli')
in Jupyter notebook or a script, the output I get is
HBox(children=(Button(description='X', ...
0
votes
0answers
65 views
Using the qiskit_textbook Package
I've installed the qiskit_textbook package in Anaconda on Windows 10 using
pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src
from the ...
0
votes
1answer
41 views
using third part modules in IBM quantum experience (Tensorflow)
Is there any option to use Tensorflow in IBM quantum experience? I have searched on google but I couldn't find anything. I thought about copying the source code, any suggestion?
0
votes
1answer
70 views
Timeout when trying to install Qiskit on macOS
I am trying to install Qiskit 0.20.0 on my machine running macOS and seeing the below error
pip install qiskit
Collecting qiskit
Using cached qiskit-0.20.0.tar.gz (4.0 kB)
Collecting qiskit-terra==0....
1
vote
0answers
61 views
Why can't we add 'rx'(Rotation around X-axis) and 'ry' gates to the noise model basis gates in Qiskit?
I can easily add any Unitary gate which I create using Qiskit but it gives a warning when I try to add these rotation gates to the noise model basis gates. It might be a problem with the labelling(I ...
0
votes
1answer
66 views
In quantum teleportation, should the X gate be before Z gate? Possible error on diagram on QisKit website
I was reading this page about Quantum Teleportation :-
https://qiskit.org/textbook/ch-algorithms/defining-quantum-circuits.html
Following this quantum circuit diagram, I calculated the quantum states (...
0
votes
0answers
26 views
qiskit's QAOA/VQE give weird results for certain Heisenberg Hamiltonians
Qiskit Aqua version: 0.7.3
Python version: 3.8
Operating system: Windows 10
I want to find ground state energies for different Heisenberg Hamiltonians using the QAOA algorithm. But for a certain ...
1
vote
0answers
37 views
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)...
0
votes
2answers
77 views
Qiskit Portfolio Optimization Application
I recently got flung into the world of quantum computing and I'm a beginner at coding. I was assigned to do the Portfolio Optimization tutorial of the Qiskit Finance Tutorials and input real data. ...
1
vote
1answer
189 views
Python quantum Fourier transform
This is the inverse quantum Fourier transform. What changes do I have to do to obtain the quantum Fourier transform (not the inverse)?
Is this in the right path at all?
How would I encode values x1,x2,...
0
votes
1answer
40 views
From DFT to QFT python/qiskit
I have the following code
x = [1, -4, 5, -2] # Data points
N = len(x) # Number of samples
n = np.arange(N) # Current sample
k = n.reshape((N, 1)) # Current frequency
e = np.exp(-2j * np.pi * k * n /...
0
votes
0answers
22 views
Could I convert a normal code (fourier transform) into Quantum via qiskit?
I have a code for the DFT, and I was wondering if there is a way to make it into a quantum version using qiskit?
I;m fairly new to it so if there's any pointers that'd be great.
0
votes
0answers
33 views
Given the quantum state, perform the Quantum Fourier Transform
Quantum Fourier transform of the given state:
1/sqrt(46) |00> - 2sqrt(2)/ sqrt(23) |01> + 5 /sqrt(46) |10> - sqrt(2/23) |11>
How can I approach this using qiskit?
0
votes
2answers
535 views
Installing qiskit-aer through pip fails
I'm trying to install qiskit on Win10.
I typed in my admin cmd :
pip install qiskit
It goes just fine for terra, ignis, and aqua.
However, I have a C compiler problem when installing aer.
Here's the ...
0
votes
1answer
77 views
My qiskit code's output differ from the Lecturer: Ryan O’Donnell
My qiskit code's output differ from the Lecturer: Ryan O’Donnell
I am testing the table shown in attached image by using qiskit in python3.8.5 and qiskit version {'qiskit-terra': '0.14.2', 'qiskit-aer'...
0
votes
0answers
35 views
Qiskit quantum fourier transform
We have 4 numbers x = [x1, x2, x3, x4]
We want to prepare quantum state Psi somehow to encode x
We want to make QFT on Psi to get Phi = QFT (Psi)
I have no idea how to approach this on qiskit
0
votes
0answers
53 views
My Bloch sphere is appearing as an ellipse/oval
I tried to plot a Bloch vector. However, my Bloch sphere is appearing as an ellipse/oval instead of a circle. I am having the same issues with qsphere also.Jupyter notebook on my Mac(Safari)
from ...
0
votes
1answer
46 views
2 entangle qubit gives all states with 25 %
We entangle two quarks; after measurement gives either |01> or |10> with probability of 50%.(regardless of their prior states ,they always give opposite states)
when I entangle 2 qubits using ...
0
votes
1answer
81 views
Shaping Numpy Arrays for pytorch GAN
(pre-processing for qiskit QGAN but the use case is somewhat irrelevant)
I'm a bit lost trying to figure out how to preprocess an image dataset before passing it through a GAN. Below is all the ...
1
vote
0answers
100 views
Failed to install Qiskit through Anaconda
Windows 10
Anaconda Python 3.7
pip 20.1.1
I trid to install qiskit on Anaconda Prompt:
pip install qiskit
and it reports error while builidng wheels for cvxpy, scs, ecos:
Building Wheels for ...
0
votes
1answer
55 views
How does DenseLayout in qiskit's transpiler work?
I'm looking for an explanation about the Dense Layout algorithm used by qiskit's transpiler.
I saw the source code, but still I don't understand what """Choose a Layout by finding the most connected ...
0
votes
1answer
188 views
WARNING: BLAS library not found, Qiskit Installation
I'm trying to install Qiskit and am coming across an error:
****************************************************************
*** WARNING: BLAS library not found.
* You can include the BLAS library in ...
0
votes
1answer
61 views
Problem executing Qiskit with Dask. Worker does not start
I am trying to execute Qiskit using Dask. When I submit a function that execute a quantum circuit simulation using Qiskit, it does not work properly and additionally, workers start to produce errors ...
0
votes
2answers
1k views
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 ...
2
votes
1answer
35 views
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(...
0
votes
1answer
158 views
IBMQProvider issue
I successfully installed and ran a couple of circuits on a backend the other day (essex).
Everything was ok, results came up, but the next day, once I wanted more QC, I could not manage to get a ...
0
votes
0answers
51 views
Python script slowing down as time progresses [Resolved]
RESOLUTION: Seems qiskit does something weird when you re-use circuits that means running them takes extra time. The solution was to pull
for idx, image in enumerate(this_data):
np.random.seed(42)...
1
vote
0answers
67 views
How to embed classical iterations into the oracle of Grover's algorithm in Qiskit?
I am newly using Qiskit to learn quantum computing. Now I want to know if there is any way to make this:
For instance, I obtain an array X, where each element is sum of something else, say X[0] = y[0]...
1
vote
2answers
839 views
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 ...
0
votes
1answer
50 views
Returning chance of qubit state as a decimal
I'm trying to run X gates on 2 qubits and then return the chance of the qubit in either state as a decimal. I've searched for answers but I haven't gotten anywhere.
##THE CODE##
import math
import ...
0
votes
1answer
24 views
while creating a quantum circuit I came across this dilemma, which circuit is better for binary operator
what are the advantages and disadvantages between 8 qbit register and 8 single qbit register?
suppose someone created quantum register with 8 qbit and another person created 8 registers with single ...
0
votes
2answers
192 views
qiskit plots not showing up in spyder console
System Informations
Qiskit version: 0.17.0
Python version: 3.7.7
Operating system: Windows 10 home x64
What is the current behavior?
I am using spyder 4.1.1 on Anaconda and any time I try to plot ...
1
vote
1answer
156 views
AssertionError: wrong color format 'ansibrightred'
I am running my old qiskit code after a very long time it's not running now showing error wrong color format 'ansibrightred' and I don't know why?
from qiskit import QuantumCircuit, QuantumRegister, ...
1
vote
0answers
115 views
How to build a complex controlled gate in the Qiskit?
I work on theory tasks in quantum computing, and make simple experiments with Qiskit. Unfortunately, I can't find a way how to make a complex control gates there, where control is in the quantum ...
0
votes
1answer
144 views
Is there an anti-control gate in Qiskit?
I started play with the Qiskit, and can't find an anti-control not there. By "anti-control" I mean the gate is executed only for these states of the superposition, where control qubit is in ...
-1
votes
2answers
39 views
How is alpha and beta found in the following complex number/trig equations in Qiskit's section 1.3? [closed]
Qiskit-Equations:
Unsure how using the trig identity one could get to that:
alpha = cos(theta/2) and beta = sin(theta/2)
1
vote
2answers
125 views
Implement quantum teleportation in qiskit
I am trying to implement the quantum teleportation protocol from the qiskit textbook in qiskit:
I start with q_0 bit = 1 and I expect that q_3 = 1 at the end but it does not work.
from qiskit ...