Questions tagged [qiskit]

Qiskit is an open source SDK for working with quantum computers at the level of pulses, circuits and application modules. If appropriate, also use the [programming] tag. Please include the version of Qiskit you use when using this tag.

Filter by
Sorted by
Tagged with
1 vote
1 answer
58 views

Trying to construct modular exponentiation gate in Qiskit

https://qiskit.org/textbook/ch-algorithms/shor.html in this tutorial I don't understand especially in how they define for the modular exponentiation gate with only swap gate (inside c_amod15 function)....
1 vote
0 answers
26 views

how do x, y, z, and h gates transform amplitude, phase, and magnitude? Affect of one gate to others?

I have been taking the qiskit and I am having trouble understanding how they work. How does the phase affect the actually probability of the output? The course also talks about the amplitude trees of ...
0 votes
0 answers
27 views

Qiskit execution of if_else with "true_body" parameter

Does anyone have experience putting a circuit in true_body parameter of if_else in Qiskit? How does it work? I’m trying to ...
1 vote
1 answer
52 views

How to get rid of multiple X gates show up as I run the code over and over in qiskit jupyter notebook?

I'm practising some code in Qiskit. However, I can't undo or get rid of previously applied gates. If you take a look at the two screenshots I'm including. The more I run my code, even though I won't ...
  • 13
0 votes
0 answers
42 views

Qiskit, possible to manipulate mid-circuit measurement outcomes?

I'm currently coding up an error correction gadget using qiskit. The one I'm doing now is 7-qubit Steane code with Steane's error correction gadget, in which the ancilla qubits are measured and then ...
-1 votes
0 answers
22 views

qiskit gates for ternary circuits

I want to using qiskit for some ternary quantum circuits. Now I want to know are the gates in this package useable for ternary circuits? or some other gates should be defined?
  • 11
0 votes
1 answer
108 views

Estimate of threshold values for 7-qubit Steane code with qiskit (or stim)

I have trouble recreating the graphs shown in this paper https://arxiv.org/pdf/quant-ph/0508176.pdf i.e. the quadratic trend of the logical error against physical single qubit error for [7,1,3] code I ...
1 vote
1 answer
56 views

Convert from QASM code to Qiskit Code

I'm looking for something that performs a conversion such as qiskit.circuit.QuantumCircuit.qasm, but for qasm code. In other words, a means to convert qasm code to ...
  • 11
1 vote
2 answers
84 views

Is there any method to parse a qasm in qiskit

I'd want to parse the qasm file for analyze the quantum gate consisting its qasm file. However, Qiskit provides the attribute of the quantum circuit, ...
1 vote
0 answers
23 views

Non-local $CNOT$ By means of Ising gates

Consider the circuit below. This is almost the same as the standard protocol to perform a non-local $CNOT_{0,3}$. The only difference is that I decomposed the upper local $CNOT_{0,1}$ into one Ising ...
0 votes
2 answers
182 views

What is the unitary matrix for a full adder? [duplicate]

I need the unitary matrix for a full adder. I want to assess how an automatically generated circuit is close to the full adder. Therefore,I need a unitary matrix for the full adder. I believe it ...
  • 11
2 votes
0 answers
27 views

Where is Qiskit's RepetitionCode class now? [migrated]

Now that Qiskit's ignis module has been deprecated, where does qiskit.ignis.verification.topological_codes.RepetitionCode or its ...
  • 189
0 votes
0 answers
22 views

How do I use specific module in Qiskit Runtime? [migrated]

I am using qiskit runtime and I need to serialize a class pass it in json format and rebuild the class once the program is uploaded. For this I wanted to use ...
2 votes
0 answers
34 views

Is there a way to access the value of a classical bit after measurement and store it as a variable (qiskit)?

I am trying to implement the one-qubit Approximate QFT for Shor's Algorithm in qiskit as described in this paper, which requires the gate $$ R_j^{\prime}=\left(\begin{array}{c} 1 \hspace{0.5em} 0 \\ 0 ...
0 votes
1 answer
46 views

Qiskit comparing circuit to desired one

I am working on a simple program using Qiskit in python in which the programs are using evolutionarily algorithms to search for a desired circuit. I need to compare the generated circuits with desired ...
  • 11
1 vote
1 answer
34 views

Adder circuit yields large errors on real hardware

I was playing with qiskit's adder example using the following code ...
  • 13
2 votes
2 answers
86 views

Why only one of the qubits is rotated in the CHSH circuit?

When reading various tutorials on how to calculate CHSH, there is only a single qubit which is rotated inside of the quantum circuit, it is also only ever rotated around a single axis. I would like to ...
  • 123
1 vote
2 answers
133 views

Is there any library that can convert a circuit drawn as text to a qiskit QuantumCircuit?

Does anyone know of a library to convert a parametrized qiskit circuit drawn as 'text' back to a QuantumCircuit or similar? I have see [this] 1 question, but ...
1 vote
0 answers
46 views

qiskit.algorithms.optimizers callback function for all optimizers

I am aware that VQE and VQC factory supports callback functions which can allow us to store intermediate values during optimization through callbacks in its arguments. However my loss function is ...
2 votes
4 answers
285 views

Why do quantum computing simulators have the measurement function?

Quantum computing simulators like qasm_simulator in Qiskit Aer have a function to simulate quantum measurements (for example, the command of ...
  • 23
0 votes
1 answer
33 views

Check gate errors of old jobs in IBMq

How can I check the gates errors and other device configurations of a past set of jobs ran in IBMQ? I have the line ...
2 votes
1 answer
211 views

How can we access GPU to execute qiskit codes. If possible give me a sample code

I'm practicing with qiskit experiments. Try to work it with GPU installed in my system. But it takes 100% performance of CPU and didn't consider the GPU. Kindly help me to run the qiskit codes with ...
0 votes
1 answer
37 views

How to set different Backend Layouts in TKet and pyQuil (Quil compiler)?

In Qiskit it is possible to describe a CouplingMap on which a circuit get executed. This helps with testing different Layouts. There are many possibilities in Qiskit on how to do this. Firstly you can ...
  • 97
0 votes
1 answer
31 views

ctrl_state 'order' of control( )

I am qurious about the order of ctrl_state The Quantum Circuit what I expected is this. q1 is controled when '0' and q2 and a3 is controled when '1' So I wirte code that is ctrl_state='011' But ...
0 votes
1 answer
50 views

How to do a partial trace over registers (rather than individual qubits) in Qiskit

In Qiskit, is the partial_trace function able to do a partial trace over registers, as opposed to over individual qubits? In the code example below, I have four registers (reg1 thru reg4) and I am ...
1 vote
1 answer
124 views

7*4 mod(15) qiskit explanation

I don't understand this circuit's output from Qiskit's doc : . Indeed, the result should be 13, but output, I think I don't have the right method to read the result. I should have $|1101\rangle$ but ...
  • 23
1 vote
1 answer
61 views

Qiskit VQE output

When running Qiskit vqe.compute_minumum_eigenvalue() a dictionary of various values are returned. Within this dictionary are two parameters called ...
0 votes
3 answers
87 views

Is it possible to get the "symbolic" matrix operator associated with a parameterized quantum circuit using Qiskit?

Qiskit provides the qiskit.quantum_info.Operator class to get the unitary matrix operator from the corresponding quantum circuit, as in the following example (here, ...
1 vote
2 answers
39 views

How to simplify sequence of gates in QASM file?

I would like to know if there is a functionality in qiskit to simplify a sequence of gates in a QASM file. For example, say we have a sequence of two expensive (in fault-tolerant context) gates $TT$. ...
  • 1,758
0 votes
1 answer
54 views

How to use local transpilation with ibmq primitives?

I want to use IBMQ's runtime Estimator primitive to address their systems. Since it has no function to return the transpiled circuit, but I need the knowledge what circuit exactly was executed in the ...
1 vote
2 answers
121 views

Why Circuit error when I use append(U)

I am new of this field. I want to make custom Unitary transform. I make a test matrix with Identity matrix. If I use UnitaryGate and append it to main circuit, it would not work. Here is my code. I ...
3 votes
2 answers
55 views

Is there a Qiskit function to encode a list of ints into a quantum state by using basis encoding?

Let's start from a basic example: suppose I have the following list containing $N=8$ non-negative ints: L = [2, 1, 2, 0, 0, 1, 3, 2] I want to encode the whole ...
0 votes
1 answer
33 views

I've wrote code on an outdated version of QisKit but what to run it on a quantum computer

like mentioned in the title I've got working code on an outdated version of QisKit which I run on my own IDE. However I am wanting to run this on a real quantum computer and I can't do this as IBM ...
0 votes
1 answer
64 views

Changing basis gates for transpilation

I want to transpile a circuit composed of CNOT and 1Q gates into Rzz, CNOT and 1Q gates such that the total number of 2Q gates is minimized. In the example below, I would like the three gates to be ...
1 vote
0 answers
46 views

Is there a way the receive the value of a specific classical register after simulation?

I have several classical registers in my circuit that I'm simulating using qiskit, and I'm looking for a way to access the simulation results of a subset of them, desirably according to their name. ...
1 vote
0 answers
20 views

noise and classical bits (measurements ) in qiskit

I am using qiskit and LocalNoisePass to add custom noise to the gates. But there is a problem when there are classical bits in the circuits. The localNoisePass give this error ...
  • 111
1 vote
3 answers
105 views

Qiskit: measure_all() or measure()

Qiskit has qiskit.circuit.QuantumCircuit.measure_all() and qiskit.circuit.QuantumCircuit.measure(). Why would you use one over ...
2 votes
2 answers
68 views

How to avoid "Delays must be a multiple of 16 samples" Error with Estimator & Sampler

I'm trying to use the Estimator and Sampler functions from the recent Qiskit version: https://qiskit.org/documentation/partners/qiskit_ibm_runtime/tutorials/how-to-getting-started-with-estimator.html ...
  • 21
3 votes
1 answer
62 views

Entangling two non-physically adjacent qubits

Entanglement can be performed just between two ** adjacent qubits** (e.g. 1 and 2) or even non-physically adjacent qubits on the processor architecture can be entangled (e.g. 2 and 6). How entangled ...
0 votes
0 answers
34 views

Entanglement purification implementation with Qiskit

I'm quite new to qiskit, does anyone have any idea how to use the reset mechanism in qiskit to perform EPP? As in the protocol one EPR pair needs to be measured and the results are checked to accept/...
1 vote
2 answers
86 views

Conversion error: from a QISKIT circuit to a QASM string and back

I created a circuit in qiskit and then converted it into a QASM string. When I try to make a circuit out of the QASM string I get the error: ...
  • 1,758
1 vote
1 answer
39 views

Evaluate a gradient with a specific backend (Qiskit)

I'm following the tutorial on gradients in Qiskit. Suppose I have the following: ...
2 votes
2 answers
150 views

State tomography on a subsystem of the GHZ state

Premise: I am not sure whether I am missing something theoretically. Given a circuit creating a GHZ state over 3 qubits, say q1, q2 and q3. If I do not consider q3 and perform a state tomography over ...
1 vote
2 answers
62 views

Error with StateTomographyFitter

I am trying to perform a state tomography over a circuit of 5 qubits named circ. I personally measure qubits 1,2 and 3. While the tomography is over qubits 0 and 4. ...
0 votes
1 answer
57 views

calculating the unitary of a circuit using Qiskit's simulator

i am trying to verify qiskit's get_unitary() result. this is my code: ...
2 votes
2 answers
179 views

Why is CircuitSampler ignoring number of shots if backend is a statevector_simulator?

I am calculating the expectation value of an operator using the CircuitSampler class as mentioned here. Now, I was getting exact same result for the expectation ...
  • 189
2 votes
1 answer
70 views

Where can I find a comprehensive list of gate decompositions used by transpilers?

Does anyone know of a web site, paper etc. that has a list of "gate decompositions" e.g. the kind of decompositions that occur when the transpiler decomposes non-native gates to native gates....
  • 197
1 vote
0 answers
69 views

Why my noise model acts different on my VQE circuit compared to a simple circuit

I have created a noise model which uses depolarizing error and I add it using the add to all qubits quantum error command. I also use readout error and add that using the add to all qubits readoute ...
2 votes
1 answer
124 views

How to define a custome gate from a matrix in TKET

I'm currently learning all about different quantum tools such as qiskit, tket, cirq, forest sdk and so on. I just want to create a circuit that gets executed given a matrix, because a circuit can be ...
  • 97
1 vote
0 answers
33 views

Error in Implementing Quantum SVM

I am getting Type error of invalid parameter in base sampler module. From what I know sampler is constructor and doesn't take any parameter values, on the qisit.org tutorial of svm they have even said ...

1
2
3 4 5
37