Questions tagged [programming]

For questions about writing code to be executed on a quantum computer, or to more generally simulate some aspect of it. For questions about a specific programming language, please also include a more specific tag.

Filter by
Sorted by
Tagged with
0
votes
1answer
36 views

Make a controlled gate from a QuantumCircuit that uses append in Qiskit

Here is a minimal example for what I want to do: ...
2
votes
0answers
61 views

Why there're two axis of rotation when I'm trying to visualize this time-evolution?

This is a follow-up question of the problem I posted earlier. The following diagram illustrates my question: I'm trying to perform the time evolution of a random Hamiltonian. The green vector ...
1
vote
1answer
34 views

How do I export the rightmost state of circuit wires (qbits and cbits) in a qiskit simulation

qiskit has a quantum teleportation tutorial which winds up with this simulation code: ...
1
vote
2answers
75 views

Finding Eigen Values from Quantum Phase Estimation - Using qiskit

I am trying to use the quantum phase estimation(EigsQPE) of qiskit to find the eigen values of a matrix. As I am new to quantum computing so I am confused what to measure in the circuit to derive the ...
2
votes
1answer
48 views

Function in Qiskit to get the quantum circuit

Is there any way to view the quantum circuit of pre implemented quantum algorithm in Qiskit? In the Qiskit textbook, there is an example given for HHL algorithm. Is there any function in Qiskit which ...
1
vote
2answers
54 views

Source code of a Qiskit's algorithm - HHL Algorithm

Is it possible to view the source code of one of the Qiskit's algorithm? Actually, I am trying to find how Qiskit implements the HHL algorithm. I want to see the source code for this algorithm.
1
vote
0answers
20 views

From Qiskit QuadraticProgram to problem model accepted by d'wave ocean

Is there a way to convert QuadraticProgram (qiskit.optimization.problems.QuadraticProgram) to BQM used in D'wave ocean (e.g. <...
2
votes
1answer
155 views

Can I plot a bigger Bloch sphere using kaleidoscope?

I'm plotting a vector on the Bloch sphere using kaleidoscope: from kaleidoscope import bloch_sphere Is there a way I can make the plot bigger? (Instead of zooming ...
1
vote
1answer
39 views

How to read QASM files for parametrized circuits (in QISKIT)? both from_qasm_file() and from_qasm_str() fail

I am trying to work with parametrized circuits in QISKIT. I can simply create parameterized circuits, bind value(s) to parameter(s), and execute/run all instances (after binding values for parameters) ...
1
vote
1answer
60 views

Uploading 20,000 lines of code to IBM Quantum Composer stalls

It is a simple 5 bit circuit, but it has 20,000 lines of QASM code. I try to put it in the composer, but the "Saving..." beside the file name will stay there for hours. I never saw its ...
1
vote
2answers
71 views

IBM Quantum Experience complains “Circuit needs at least one measure.” But, the circuit does have one!

I want to run this simple test on the IBM quantum computer ibmq_lima, but it complains about the measurement. As you can see, there is one "measure". The weird part is that it works if I ...
1
vote
1answer
51 views

How to use QFT operation in Q#?

I see the QFT operation in the document given by Microsoft, but I don't know how to call it. ...
1
vote
0answers
24 views

Amazon Braket Token Exception [closed]

I am attempting to run a job on Amazon Braket via the integrated Jupyter Notebooks, but I'm receiving an ...
2
votes
1answer
97 views

Error 400 on submission request on job that ran before

since today in the morning I am always getting the following error while running a job on IBM Sydney "'Error submitting job: '400 Client Error: Bad Request for url: https://api-qcon.quantum-...
1
vote
0answers
56 views

How to divide one quantum circuit into multiple sub-circuits in qiskit?

While I'm simulating one Big quantum circuit in Qiskit, I wonder how we can divide one big quantum circuit into several sub-circuits. I looked in Qiskit API documents, but I couldn't find it. Is there ...
5
votes
1answer
58 views

Can I simultaneously plot 2 vectors on a single Bloch sphere and rotate the angle of visualization?

I'm trying to plot 2 vectors on the same Bloch sphere. From the qiskit documentation here, we can find ...
1
vote
1answer
40 views

How to create an observable: 'Identity \tensor Pauli gate' in Cirq

I am working on an implementation of the RQAOA algorithm on the Maxcut problem in Cirq. My graph G has n vertices. And after running a QAOA circuit with n qubits I obtain a state gammabeta (a vertical ...
1
vote
0answers
46 views

In Cirq, how do you display circuit diagrams that are “prettier” than the ones displayed by default?

This is a duplicate of a question that was asked on the Cirq issues page. I'm duplicating this question to increase it's visibility. The standard way to print circuits in Cirq is by calling ...
0
votes
1answer
65 views

Qiskit not finding CPLEX

I'm trying to use the CPLEX library alongside Qiskit but keep getting the error. ...
0
votes
1answer
45 views

Best way to compute $\langle a|B|a \rangle$ in Cirq, where a is a state obtained running circuit A. And B is a different Quantum Circuit

I am implementing RQAOA in Cirq. After running regular QAOA to find an optimal state a (This I have done successfully). I need to calculate $\langle a|Z_iZ_j|a\...
3
votes
1answer
70 views

What all parameters can we take into account when comparing different quantum programming languages

I am planning to write a paper which compares Qiskit and Q# in the following circuits/algorithms Bell circuits Controlled swap to test similarity of two registers Phase kickback between two qubits ...
3
votes
1answer
69 views

Running Qiskit Circuit Composer locally on Jupyer Notebook

I was wondering if I could use Qiskit locally on Jupyter Notebook and thus loaded my IBM-Q account via API token. I could construct circuits execute jobs but when I tried to use circuit composer, it ...
3
votes
2answers
218 views

How to initialize a qubit with a custom state in Qiskit Composer

I'm trying to initialize a qubit with a custom state in IBM's Qiskit Composer. I wrote the code in the Qiskit Lab and obtained the QASM code as shown below ...
2
votes
0answers
26 views

What would be a real-life example of using a quantum workflow oriented tool/environment, such as through Orquestra?

Recently, a unified quantum software and hardware platform, Orquestra was released. My question is, what could be a real-life (step by step) example of using this kind of workflow? As existing quantum ...
5
votes
1answer
47 views

Is there a way to use titles on circuit drawing?

As you may know, one can use barriers in Qiskit to seperate gates on a circuit in a proper way. So, I was wondering is there a way to give a title to these "sections" seperated by barriers? ...
0
votes
0answers
20 views

How to use 'RevLib' files in python?

RevLib is an online resource for benchmarks within the domain of reversible and quantum circuit design. It provides a database of functions with respective circuit realizations given in a appropriate ...
5
votes
0answers
71 views

Quantum implementation of arcsin

I am looking to implement a quantum version of the arcsinus function. Such a problem is motivated by the HHL algorithm where $x\mapsto 1/x$ and $\arcsin$ can be used to get $1/x$ from the ...
2
votes
0answers
62 views

Two qubit gate decomposition in using Qiskit

I am writing some python code to be able to optimise the total error in two qubit gate decomposition. I am using the Qiskit module qiskit.quantum_info.synthesis.two_qubit_decompose My question relates ...
0
votes
1answer
53 views

How to set matplolib as default circuit drawer?

I've already tried the instructions on the qiskit page and even from this other question What is the location of the Qiskit config file? but it doesn´t work, the circuit keeps looking as text based, ...
0
votes
1answer
50 views

How do I convert a Quantum Circuit into a qobj

I have a Quantum Circuit launched but I want to convert it into a qobj to use the function .run from qiskit, I've tried to use the function: ...
0
votes
1answer
74 views

Memory Requirements for Qiskit Aer Simulator

I'm trying to work out how much memory is used for simulations of different sizes using the Aer simulator. Here are my calculations: $$ \text{Number of Qubits} = n $$ $$ \text{Number of Amplitudes} = ...
3
votes
0answers
35 views

Trying to simulate Weak Value Amplification using QuTiP

Weak Value Amplification is a procedure in which one consider a bipartite Hamiltonian of the form $H = g A \otimes B$, where $A$ is called system, $B$ is called meter and $g$ is the extremely small ...
1
vote
1answer
45 views

Is there a way to present conjugate transpose of a Y Pauli rotation as a Cirq Operator?

Given: Ry(theta) acting on one qubit I'm trying to use existing Cirq Operators to build the conjugate transpose of the above gate. I need the operator to produce the exact unitary of the given gate ...
0
votes
0answers
59 views

How can I represent Pauli Measurements in Qiskit's QuantumCircuit object?

Is there a way to represent measurements in other bases in Qiskit? The default measurement is in the Z (computational) basis. Can I also depict measurement in X, Y and general Pauli Measurements? I ...
1
vote
0answers
80 views

Is qiskit documentation about determining $|0\rangle$ and $|1\rangle$ incorrect?

I'm using pi-pulse pulses on qubit Armonk for determining 0 and 1 by Machine Learning. But when I run the code from https://qiskit.org/textbook/ch-quantum-hardware/calibrating-qubits-pulse.html. I get ...
2
votes
2answers
368 views

Does IBM have a publicly available tutorial on applied quantum computing and how does one use it? Any Reviews of the Tutorial?

I found this link and I am wondering if anyone has used it to learn or develop applications? I would like to know if people find it worth the time. I am reading the material by the way. https://...
2
votes
1answer
42 views

Design NISQ Circuit with StrawberryFields

I am trying to design this circuits with strawberry fields. However I could not connect my first and second qubit mode: orange boxes are beam splitters, blue boxes are phase shifters. The green box ...
1
vote
1answer
67 views

Error while running Qiskit code on real quantum computer

I was trying to run this code on a quantum computer but I was getting an error can anyone suggest how to resolve this error? ...
1
vote
1answer
64 views

Need some help with simulating molecules with VQE

I have studied the example of the simulation of LiH molecule in Learning Quantum Computation using Qiskit. It is available on this link: https://qiskit.org/textbook/ch-applications/vqe-molecules.html#...
1
vote
1answer
62 views

Why does the Qiskit tutorial for the Variational Quantum Linear Solver not work properly?

I am following this very nice qiskit tutorial on how to implement a simple variational quantum linear solver (VQLS). There are 3 examples implemented in the tutorial all of which are solving the $Ax=b$...
3
votes
1answer
44 views

Should I learn a low-level QC programming language?

I've referred to some programming language recommendation questions on here, so I thought I'd post a follow-up question here. I'm a total beginner to the field but want to seriously learn it. Is there ...
0
votes
1answer
57 views

How do I get sate vector for each shot running on a quantum computer?

I was running this code on a quantum computer how can I generate a state vector for each shot while running on a quantum computer? qikit code ...
1
vote
1answer
41 views

Can I see Probability in complex form after measuring the state of the qubit on quantum computer?

Let's say I have a qubit $$\left| \psi \right> = (\alpha_1 + i\alpha_2 ) \left|0\right> + (\beta_1 + i\beta_2 )\left|1\right>$$ so when we measure it will calculate $|\alpha_1 + i\alpha_2|^2$...
3
votes
2answers
85 views

Statevector Simulation of QAOA always finds exact solution

My question is simple: does applying QAOA with a statevector simulation always result in a perfect solution? I'm trying to calculate the best $\gamma$ & $\beta$ that solve certain problems but my ...
3
votes
1answer
70 views

How to make a half adder for x number of qubits with min. cost?

How to make a half adder for N inputs and getting the output on another x+1 output. Where x ...
2
votes
3answers
68 views

Is it possible to see the probabilities values of qubit ( alpha and beta) while measuring on IBM Quantum experience?

Is it possible to see what are the values of $\alpha$ (probability of being in state zero) and $\beta$ (probability of being in state one) while running on IBM Quantum simulator (we can call it state ...
3
votes
1answer
84 views

How do I Initiate with my own alpha and beta values instead of starting form qubit in state zero in IBM Q?

Let's say I have normalized values of $\alpha$ and $\beta$ as $\alpha =(0.27524094128159016+0.8257228238447705j)$ $\beta =(-0.22019275302527214+0.4403855060505443j)$ How do I initialize my circuit ...
0
votes
3answers
41 views

Quantum Error Correction implementation in Qiskit, OpenQASM or other languages based on Python

Where can we find example(s) of implementation code in a programming language of Quantum Error Correction, whether with the standard method of measurement or the automatic method without measurement (...
1
vote
1answer
38 views

How can we code a ccz (control control z, equivalent of Toffoli on Z and not on X) gate in Qiskit language?

How can we code in Qiskit, a ccz gate ? In python (in https://qiskit.org/textbook/ch-algorithms/grover.html), we see three instructions : qc.h(nqubits-1) qc.mct(list(range(nqubits-1)), nqubits-1) # ...
2
votes
0answers
43 views

QISKit not installing in PyCharm

I am attempting to setup a PyCharm project to study and work through the QISKit textbook. However I seem to be running into a propblem seting it up. I have setup a python enviroment via anaconda (...

1
2
3 4 5
19