All Questions
Tagged with python or programming
1,724 questions
2
votes
0
answers
40
views
How to use Qiskit translation pass manager with Clifford + T gate basis?
Context
In qiskit, the translation stage of the transpilation "translates (or unrolls) the gates specified in a circuit to the native basis gates of a specified backend." (cf doc)
For that, ...
1
vote
0
answers
43
views
Operation 'sx' is not defined for this system
Any one knows how to resolve the below error:Operation 'sx' is not defined for this system. The below code works really well with ...
1
vote
0
answers
14
views
Periodic electric field link operator in QuSpin
I am trying to implement a truncated bosonic Hilbert space as described in Eqs. (15) and (16) of this paper on simulating the Schwinger model. However, I am unable to implement the "periodic ...
1
vote
0
answers
21
views
What is the difference between `HighLevelSynthesis` and `UnrollCustomDefinitions` qiskit transpilation passes?
The doc for UnrollCustomDefinitions indicates :
...
1
vote
1
answer
255
views
Simple successor gate
I want to create a gate that, given a sequence of qbits that encode n, transforms that sequence in n+1, in other words the successor function. I managed to do it in qiskit by writing this:
...
1
vote
0
answers
33
views
I have trouble using the alternatives for some commands in older versions of qiskit
I have a code that calculates the transition amplitute between and using the ZZFeatureMap with 4 repetitions and default data mapping function. Use the qasm_simulator with shots = 8192, seed_simulator ...
1
vote
0
answers
12
views
Custom Feature Map Error for VQR in Qiskit 'Input data has incorrect shape, last dimension is not equal to the number of inputs'
I am trying to use a VQR for solving a regression problem. My data has 5 features, I want to use 4 features to estimate 5th one. I made it work with ZFeatureMap but now I want to create my own feature ...
2
votes
1
answer
110
views
why does this get DAGCircuitError?
When I run the simple circuit that just does multi-controlled rotation I had the error:
"DAGCircuitError: 'bit mapping invalid: expected 4, got 1'".
It seems the error occurs when a ...
1
vote
0
answers
17
views
How to get historical calibration data for mthree (M3) from IBM Quantum devices?
I'm using mthree in Batch mode. A batch needs to be queued before it can be executed. The time when a batch was executed can be obtained from the IBM Quantum Platform site, so I would like to obtain ...
-4
votes
1
answer
54
views
What if oscillation-based computing is the generalization of quantum computing? [closed]
This question contains both engineering perspectives and science perspectives.
Here is my definition about oscillation-based computing:
Oscillation-based computing is the computation where the input ...
2
votes
1
answer
46
views
Comparing Qiskit gates with numpy functions
I am trying to understand how Qiskit's gates work by comparing the outputs of a simple circuit with numpy matrix algebra.
If I start with two qubits and apply a rotation gate to each of them, I get:
<...
2
votes
1
answer
106
views
Fastest method to find any single error for a given stabilizer set and given syndrome
I am working on trellis structures of stabilizer codes, where I construct a trellis for a given set of stabilizer generators and a given syndrome. I want to find any arbitrary error out of all the ...
2
votes
1
answer
325
views
Migrate Algorithm using latest IBM Qiskit SKD (v1.2.4) for Python
I am looking for an implementation of an algorithm using the IBM Qiskit SDK for Python.
I know that there is an implementation for Qiskit v0.x but I am missing an implementation for the current/latest ...
1
vote
1
answer
93
views
Actual execution time on real hardware
I am trying to calculate the actual execution time on real HW. We have access for IBMQ systems.
What I am thinking is that to find the actual execution time on real HW so that we can know whether our ...
0
votes
0
answers
46
views
How to learn mathematics and physics for quantum computing
I am currently pursuing my bachelor's in computer science (AI). I am very passionate and curious about quantum technologies, particularly quantum information theory, and quantum computing, and I want ...
1
vote
0
answers
41
views
Quantum register for variable store - how to encode operations?
Suppose I have a lot of classic variables of a certain number of bits in size, say, 8 bits. Instead of starting each variable from zero in superposition, I want to use the exponential space to encode ...
2
votes
1
answer
143
views
The number of qubits of the ansatz does not match the operator
I am trying to run my below code on FakeSherbrooke() system, but I am getting an error as shown below:
...
0
votes
0
answers
31
views
Discarding a Quantum register to extract kernel matrix in practical quantum computer
Question: How to extract a kernel matrix from a quantum state on a real quantum computer through discarding a register?
I am trying to understand the paper "Quantum Support Vector Machine for Big ...
1
vote
1
answer
76
views
Where are quantum register operations defined?
Suppose I have three registers of many qubits, $$x, y, r$$
I want to define a quantum gate mapping the sum of $x$ and $y$ to $r$, or more generally from any operation over $x$ and $y$ to $r$. The ...
1
vote
1
answer
46
views
QPE implementation with 4 qubits
I'm trying to implement a circuit for QPE, i start with 4 qubits but the results are incorrect (even for 3 or 5 qubits).
the used unitary gate is : ...
0
votes
0
answers
54
views
Usage of custom passes during transpilation
I am reading a lot about custom passes in the qiskit like
...
0
votes
0
answers
60
views
Cannot Find referance DeutschJozsa in __init__.py
I am new to quantum computing and Python. I tried to make a quantum simulation with qiskit, but I have some import issues that I can't solve, and I decided to ask it here.
I tried to import ...
0
votes
0
answers
36
views
How to generate random quantum states in matlab?
I was wondering if there is some academic standard/any way of generating random n times n q-states/density matrices in Matlab without using any other package then QETLAB.
-2
votes
1
answer
82
views
No module named qiskit-algorithm
I want to try the quantum computing simulator, but when I try to import the Algorithm, the Qiskit shows an error. For your information, I am currently running Qiskit using Google Colab.
This is the ...
2
votes
1
answer
110
views
How to download historical calibration data from IBM quantum devices?
I want to download the data tables from either the current QPUs or the previous ones (that have fewer qubits) from IBMQuantum. However, when I try to look at answers like Is there an archive of IBMQ ...
-5
votes
1
answer
60
views
qml.device error
I am having an error when calling the device:
...
0
votes
0
answers
45
views
RuntimeJobFailureError: 'Unable to retrieve job result. Error code 1520; The instruction cost per qubit exceeds the system limit
I want to find two operands of multiplication result of 180. In another word, finding integer factors of 180.
I'm using ...
1
vote
1
answer
86
views
Simple QisKit circuit seems to return incorrect statevector?
I have below a very simple circuit that initializes 2 qubits, and then saves the statevector. I cannot figure out why the simulator returns a vector of all 0's for the statevector. I'm using an older ...
0
votes
0
answers
207
views
optimizing the circuit depth of a quantum circuit while using Fake Hardware
I am trying to search some ways in qiskit==1.0 to reduce the circuit depth while using Fake HW.
What I understand is that changing the optimization level to 3 will ...
1
vote
1
answer
65
views
Probable bug in DumpMachine() Quantum API function of Microsoft Quantum Platform
According to help from Microsoft Learn, the binding of Qubit[] array to its equivalent ket vector representation is such that the qubit with index 0 becomes the ...
2
votes
0
answers
77
views
How to simulate a beam splitter in QuTiP?
I'm trying to mix two states on a beam splitter whose unitary operator is
$$\hat{U}=e^{i\theta \left( \hat{a}^†\hat{b} + \hat{a}\hat{b}^† \right)},$$
where $\hat{a}$, $\hat{b}$ are annihilation ...
1
vote
0
answers
28
views
Is mcsolve from QuTiP Optimal for Solving Large Systems in the Lindblad Master Equation?
I am transitioning from using Mathematica to Python for my work on quantum systems, specifically focusing on solving the Lindblad Master Equation. For this purpose, I've started using the mcsolve ...
1
vote
2
answers
129
views
Why does quantum circuit need to be run even though the probability is already in the formula?
In classical computing, it's clear by intuition why we need to run a program code to check whether a large odd integer number is prime or not.
It can be computed manually for such large number, but of ...
1
vote
1
answer
59
views
Noisy expectation value of non-Pauli observable in qiskit
I would like to calculate an expectation value of a general operator in a noisy simulation with qiskit.
The usual way of doing this is via an Estimatorwith a noise ...
0
votes
1
answer
86
views
Can quantum computers eventually be programmed "normally"?
They tell us that eventually quantum computers will break all current encryption methods. On the other hand, current quantum computers are programmed at a very low, mathematical level and for very ...
0
votes
1
answer
59
views
How to program Grover's Operator?
I understand the theory behind Grover's operator but I still am unsure how to code it. I have a quantum circuit with 13 qubits. Could someone please tell me step by step the code to use for Grover's ...
1
vote
1
answer
29
views
Unexpected behavior of trapped ion's motional mode (phonon) heating simulation
I'm a novice at qutip simulation.
I was recently trying to use qutip to simulate the heating effect of a trapped ion by defining a jump operator defined with heating rate.
Below is the code of my ...
0
votes
0
answers
19
views
How does amplitude amplification work (in Grover's Algorithm) and does this code for it work?
I understand amplitude amplification at a high level: operations and gates are applied to the qubits such that the solution states amplitude is raised while the non-solution states are lowered. ...
0
votes
1
answer
51
views
To output syndrome measurement results
May I ask you a question about the following? GitHub - Infleqtion/qLDPC: Tools for constructing and analyzing quantum low density parity check (qLDPC) codes.
In the above code, is there any code that ...
3
votes
0
answers
40
views
Transpilation error: CircuitError: 'The amount of qubit(0)/clbit(0) arguments does not match the gate expectation (2).'
I am trying to implement a algoritm that reduces the number of qubits required for MAXCUT optimization. I need to create a custom gate that encodes a diagonal unitary matrix where the diagonal ...
0
votes
1
answer
71
views
Uniformly sampling a random 3 qubit clifford gate
I try to uniformly sample 3 qubit clifford gates and apply them to my circuit. I'm using python language. I'm following this paper https://arxiv.org/abs/quant-ph/0406196 (Supplementary Materials 1....
1
vote
0
answers
40
views
Applying 2-qubit noise to a multi qubit system using local operations in Python
I am trying to create a simulation of 2-qubit dephasing noise that acts on the first two qubits of a multi qubit system. I would like to do this locally rather than expanding my kraus operators into $...
2
votes
1
answer
66
views
eigenstate is missing in the solution of vqe.compute_minimum_eigenvalue API in qiskit==1.0
I am using an API result= vqe.compute_minimum_eigenvalue using different version of qiskit. The qiskit==0.46 gives ...
1
vote
1
answer
81
views
Getting negative probabilities in the count result
I am struggling with a very basic concept.
What exactly is the negative probability means in count result?
When I run a circuit without error mitigation and with error mitigation using a really great ...
2
votes
1
answer
533
views
Substitute for QuantumInstance in latest qiskit==1.0
I have a old version of qiskit==0.46 code which uses the below syntax:
...
0
votes
2
answers
73
views
qiskit.exceptions.QiskitError: 'Invalid input data for Pauli.'
I have some old version qiskit==0.46 code which uses an API as below:
...
1
vote
1
answer
122
views
Using statevector in latest version of qiskit==1.0
I am trying to use migrate my code from old version of qiskit to the latest version qiskit==1.0 for the statevector.
...
0
votes
1
answer
80
views
qiskit.providers.basic_provider.exceptions.BasicProviderError: 'basic_simulator encountered unrecognized operation "ucry"'
I need some help in running circuit on qiskit==1.0 simulator.
The documents says:
https://docs.quantum.ibm.com/migration-guides/qiskit-1.0-features
...
0
votes
1
answer
33
views
AttributeError: Options field max_parallel_threads is not valid for this backend
I am working on migrating my code to the latest version of qiskit==1.0. Below is a part of my code:
...
2
votes
1
answer
154
views
AttributeError: 'QuantumCircuit' object has no attribute 'ucry'. Did you mean: 'cry'?
I am trying to update my code to latest version of qiskit==1.1.1 Earlier we used to have a gate called as qc.ucry, but now I am ...