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
0
votes
0 answers

Why does removing the uncomputation step at the last iteration of Grover's algorithm worsen results?

When messing around with qiskit.org's article on Sudoku solving with Grover's algorithm, I noticed that removing the uncomputation step in the last iteration of the algorithm worsened the likelihood to get valid solutions from running the program.…
Lucas
  • 106
  • 1
  • 1
  • 7
0
votes
1 answer

How can I visualize image using qiskit in vscode?

I'm now trying to run qiskit visualization functions(e.g. .draw() methods) in vscode. I use latest version of Python, 3.11.1, and followed Getting Started Qiskit in here. Also I installed qiskit extension in vscode. However, when I run a qiskit…
0
votes
1 answer

How can I make this density matrix on qiskit

I want to make the density matrix on qiskit. The state is ρ=[7/9,0 ; 0, 2/9]. At first, I'm gonna make that matrix by unitrary transform from |0>. But I realize that it cannot happend. Because there is no unitary transform which satisfy…
0
votes
1 answer

ket.draw() not showing |00> : Qiskit

ket.draw() must give |00> as result but I get: Statevector([1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j], dims=(2, 2)) what can I change to get the desired result? This is my code: from qiskit import QuantumCircuit from qiskit.quantum_info import…
Maria
  • 1
  • 3
0
votes
0 answers

Grover, CCZ Gate on IBM Quantum Lab & unexpected outputs

Studying Grover on IBM lab using Qiskit. But the following code produces unexpected outputs. Note that PhaseOracle produces 2 CCZ gates. *Could anyone check(and explain) why are those unexpected counts/outputs(given at the bottom) being…
EA_Oracle
  • 1
  • 1
0
votes
0 answers

How to add two Bits using single Qubit on Quantum Computer

As we knew that a qubit have the capacity to store two bit at a time. I am curious to add two bits using single qubit. I try a lot but failed, please give some hints if someone know. Code: from qiskit import QuantumRegister, ClassicalRegister,…
0
votes
0 answers

How do I run a QuantumCircuit?

I'm fairly new to quantum algorithms and I went from IBMQ Composer to the Python style of writing circuits. My question is: The code bellow just draws the circuit, is there a way to run the circuit and get the output without having to write a…
0
votes
1 answer

In what state is this 3-qubit state?

So, I have a state of 3 qubits that is in one of the states in the picture. How can I find out which state it is in? I tried to measure the qubits but the amplitudes are 1/3 for each, so...
Bob
  • 1
0
votes
1 answer

do fit function of QSVC require float values as parameters?

Following is my code. The error seems to be in qsvc.fit() line but I can't understand why.one of the error line says "TypeError: Invalid parameter values, expected Sequence[Sequence[float]]." I'm pretty much sure I have passed arrays as parameters…
0
votes
1 answer

Measurement of unentangled qubits

If I have two independent (unentangled) qubits, let's say one in state |1> and the other one in some superposition state with equal amplitudes and arbitrary phases. If I measure the qubit that is in the superposition state (and let's say get 0), it…
0
votes
1 answer

How to Initialize the Qubits in IBM Quantum Composer

Step 1 Qisqit : Here is the code of Qiskit. I have initialized the four qubits. qr1 = QuantumRegister(4) mea = ClassicalRegister(2) circuit = QuantumCircuit(qr1,mea) initial=[[1,0],[0,1]] circuit.initialize(initial[1],…
0
votes
1 answer

How to keep visualizations (i.e. draw('mpl')) displayed while other code is called

I would like to be able to save and call a visualization, then have it show in-between other code. I know with MatPlotLib, you can do plt.show(), is there anything like that for Qiskit? def test(): return plot_bloch_multivector(circ) print("This…
0
votes
1 answer

Unable to install NLopt for Qiskit

So I am following the instructions on this site, https://qiskit.org/documentation/stubs/qiskit.algorithms.optimizers.nlopts.html#module-qiskit.algorithms.optimizers.nlopts However, I am able to run this command ./configure --enable-shared…
0
votes
1 answer

@staticmethod used in qiksit hybrid neural network

I am very new to python. I was studing some code from qiskit - https://qiskit.org/textbook/ch-machine-learning/machine-learning-qiskit-pytorch.html. I have a lot of doubt in the below code. After doing some study of neural network, I can intrepret…
mchaudh4
  • 65
  • 5
0
votes
0 answers

Unable to retrieve result for pulse job in IBM Qiskit

Environment {'qiskit-terra': '0.21.1', 'qiskit-aer': '0.10.4', 'qiskit-ignis': None, 'qiskit-ibmq-provider': '0.19.2', 'qiskit': '0.37.1', 'qiskit-nature': '0.4.2', 'qiskit-finance': '0.3.3', 'qiskit-optimization': '0.4.0',…
Monica
  • 101
  • 2