Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [qasm]

Quantum assembly language (QASM) called OpenQASM is used to implement experiments with low depth quantum circuits. OpenQASM represents universal physical circuits over the CNOT plus SU(2) basis with straight-line code that includes measurement, reset, fast feedback, and gate subroutines. The simple text language can be written by hand or by higher level tools and may be executed on the IBM Q Experience. (arXiv:1707.03429)

Filter by
Sorted by
Tagged with
0 votes
3 answers
85 views

How to implement multi controlled X gates in Qasm

I wanted to know the easiest way to implement a large multi controlled x gate using Qasm and not Qiskit, if it's possible
beginnerCoder7's user avatar
2 votes
0 answers
25 views

VQE on Qiskit: getting counts per Hamiltonian term

Consider a VQE calculation (using the QASM backend and on Qiskit) that involves a qubit Hamiltonian with, say, 5 terms. Is there a way for us to get the counts for each of the Hamiltonian terms that ...
srinivasa prasannaa's user avatar
1 vote
0 answers
30 views

How to represent the gates and the quibit states in the 'Hello Quantum' iOS game in IBM Quantum Learning graphical simulator

The Hello Quantum ios game developed by IBM has the X, Z, H and CZ gates manipulating a 2 qubit array (im not sure if array is the right word?). I want to know how I can represent the qubit states in ...
chickenj0's user avatar
6 votes
1 answer
127 views

Are there tools I can use to test OpenQASM 3 circuits?

I recently added a to_qasm method to stim. An issue I'm having is how to test that the outputs are correct. I can test OpenQASM 2 outputs by giving the output to ...
Craig Gidney's user avatar
  • 37.7k
1 vote
1 answer
76 views

Limited qubit number available in Aer Statevector simulator

I tried to run a calculation of 37 qubits with a Statevector simulator on Qiskit. The following is a demo code. ...
Marxmas's user avatar
  • 107
1 vote
1 answer
190 views

If Statement OpenQasm 2.0

in the documentation for OpenQasm 2.0 it says one can use an if statement like so: if(c_reg==int) Quantum Operation. However, I would like to execute the following: ...
Sam's user avatar
  • 31
1 vote
1 answer
86 views

New QASM2ParseError for old circuit on IBM composer

A while ago I wrote an example of quantum teleportation circuit in the IBM Composer which ran fine as of three days ago. Yesterday, however, when I try to run the circuit, I get the following error: ...
Lachlan Belcher's user avatar
0 votes
0 answers
37 views

How to augment a QASM circuit for orbital rotation

Could anyone advise on how to properly augment the hamiltonian circuits in https://github.com/CQCL/ethz-hackathon22/tree/main/benchmarking/circuits for orbital rotation ? https://poe.com/s/...
kevin's user avatar
  • 7
2 votes
2 answers
355 views

How to get QASM code from an Amazon Braket circuit in Python?

As an example, consider the following Circuit defined by using the Python amazon-braket-sdk: ...
SimoneGasperini's user avatar
3 votes
2 answers
2k 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 ...
Loqi's user avatar
  • 31
1 vote
2 answers
396 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, ...
Sanghyeon Lee's user avatar
1 vote
2 answers
137 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$. ...
MonteNero's user avatar
  • 2,646
1 vote
2 answers
349 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: ...
MonteNero's user avatar
  • 2,646
3 votes
1 answer
264 views

OpenQASM circuits in Stim

I would like to run circuits saved as OpenQASM circuits in Stim. Does anyone know how to import these circuits from OpenQASM to Stim? Many thanks.
user206444's user avatar
4 votes
0 answers
35 views

How does it work QasmSimulator with the option "density matrix"?

I am making some simulations on IBM Quantum Lab and as backend I tried to use QasmSimulator(method = "density_matrix") in order to simulate noise. I wanted to know how this method works in ...
Natale Matranga's user avatar
3 votes
1 answer
212 views

I would like to use Open QASM 3 what if any backends can I use to?

From my limited understanding Azure Quantum and IBM Qiskit backends do not support OpenQASM 3. However, Amazon Braket does support a subset of Open QASM 3 (proof). What is the best way/backend to test ...
EXA_Q's user avatar
  • 31
4 votes
1 answer
253 views

Does Qiskit allow for QASM 3.0 code to be utilized?

I am interested in using QASM 3.0 after reading it's documentation and seeing it's examples 1. However, I see that in IBM Quantum Experience QASM 3.0 is not supported yet. Is there any way I can run ...
Ryan's user avatar
  • 41
2 votes
3 answers
1k views

What are the differences in using qasm, statevector, and unitary simulators in qiskit?

From my understanding statevector is a more simplistic using vector space, qasm is supposed to introduce noise like running it on an actual quantum computer. What types of problems would you use one ...
Jeremy's user avatar
  • 47
2 votes
0 answers
328 views

Does Qasm Simulator add noise by default?

I am wondering if Qiskit QasmSimulator adds noise by default or not. I am asking because I have 2 circuits: circuit 1: computes cosine similarity between two vectors circuit 2: computes cosine ...
Yousef Zook's user avatar
1 vote
0 answers
71 views

How to perform lattice surgery with initial state $|0\rangle+|1\rangle$, with qasm?

I am trying to perform a lattice surgery. Initial state is $|0\rangle+|1\rangle$ and when I perform a smooth merge and split, I think I get $|00\rangle+|11\rangle$ but it doesn't work. Is there ...
kaluza19's user avatar
9 votes
1 answer
4k views

What are the differences between Qiskit's AerSimulator, QasmSimulator and StatevectorSimulator?

In Qiskit, we can see the names of available simulators with the command Aer.backends(). These include: ...
user3886914's user avatar
6 votes
1 answer
1k views

Where is definitive documentation for OpenQASM 2.0 and 3.0

I have gotten conflicting information about OpenQASM; some sources point to version 3 while others say 3 is not ready. I want to refer to a document that will tell me what instructions actually work ...
Anna Naden's user avatar
3 votes
1 answer
299 views

Qiskit does not interpret qasm string as 3.0?

I am trying to get my first openqasm3.0 program and I am getting error messages that I cannot interpret. Here is my program: ...
Anna Naden's user avatar
2 votes
1 answer
293 views

How to convert code from QISKIT to QuEST using QASM

I have been working on this project which requires a lot of qubits. Originally we have made the whole project in QISKIT as we have been using it for a long time. But the maximum number of qubits that ...
Parmeet Singh EP 066's user avatar
1 vote
1 answer
198 views

QASM Files on Jupyter Notebook

Is it possible to run qasm files on jupyter notebook (like with the qasm_simulator)? I downloaded one code file and I would like to play around with it on jupyter notebook.
Berni89's user avatar
  • 19
1 vote
0 answers
166 views

How can I get the results from simulating noise models?

I'm trying to run some simulations of my quantum circuits using qasm simulator. I first tried to import the noise data from a quantum device and then use that information on qasm. Here's part of my ...
ZR-'s user avatar
  • 2,388
1 vote
2 answers
115 views

Are we using the real-time error information in simulating noise on qasm?

I'm trying to run some quantum circuits on qasm simulator using the noise information from IBM Q quantum device: ...
ZR-'s user avatar
  • 2,388
3 votes
1 answer
988 views

Simulating OpenQASM 2.0 in Qiskit?

I'm just getting started with OpenQASM, but I'm feeling a bit confused. Is there a way to run the .qasm file I've written in Qiskit (i.e. in Python), or is OpenQasm ...
stare100's user avatar
0 votes
1 answer
215 views

How to build and visualize circuit from matrix?

In paper Efficient quantum algorithm for solving travelling salesman problem: An IBM quantum experience, the authors use gate $U_j$ and its decomposition $$ U_j = \begin{pmatrix} \mathrm{e}^{ia} &...
Pritam Sinha's user avatar
1 vote
1 answer
65 views

Use of Data loaders or State Initialization Circuits

I have recently started working on qiskit and I am struggling to use qc.initialize API in any practical or useful application. I have read at multiple places that ...
Manu's user avatar
  • 493
2 votes
1 answer
209 views

Is it true that QasmSimulator is much slower than StatevectorSimulator, or am I doing something wrong?

I'm trying to calculate the expectation value of some operator for a state that comes out of a quantum circuit using Qiskit. I was initially using ...
A. Jahin's user avatar
  • 264
3 votes
1 answer
323 views

IF statement in OpenQASM2.0 on IBM Quantum Experience -- error

I have written the following toy .qasm file, which has some adaptive measurements: ...
fcrp's user avatar
  • 156
3 votes
1 answer
397 views

Is there a way to within a quantum circuit work out if a qubit is in a superposition or not?

Preferably using the gates found in QASM/Qiskit and the qubit stays in the superposition and no measurement is made, i.e. the output of if it is in a superposition or not is a binary answer in another ...
Tom's user avatar
  • 45
1 vote
1 answer
464 views

How to import circuit libraries into qiskit

Im trying to put the QFT circuit in my qiskit circuit but im having trouble: ...
dude's user avatar
  • 37
3 votes
1 answer
183 views

Why does running my circuit on Quantum Hardware produce such unexpected results?

I am using Jupyter Notebook with Qiskit. I have created a program that can add two 3-bit numbers together. When I simulate this program on a qasm_simulator it works as expected and I can add any two 3-...
John's user avatar
  • 107
2 votes
3 answers
1k 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) ...
Ramin's user avatar
  • 21
2 votes
3 answers
359 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 ...
User1086's user avatar
3 votes
3 answers
244 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 (...
Bertrand Mercier's user avatar
2 votes
1 answer
128 views

Is it possible to modify pulse schedules in QASM?

Is it possible to modify a pulse schedule of a circuit compiled using QASM? I know this is possible using OpenPulse, but it seems none of the IBM backends support OpenPulse. So is it possible to do ...
user14536's user avatar
1 vote
0 answers
54 views

Why do I get the error 'IBMQManagedResultDataNotAvailable'?

I'm trying to use IBMQ job manager to submit a list of quantum circuits (300 of them in total) to 'ibmq_16_melbourne'. This is what the job status looks like on IBM Quantum Experience: I don't know ...
ZR-'s user avatar
  • 2,388
1 vote
1 answer
177 views

Is there a faster way to get 'a list of' result from 'a list of inputs'?

I had a question about obtaining the probability of a certain state from the histogram, still using this example, suppose there's a variable in my quantum circuit, it's values are stored in an 'np....
ZR-'s user avatar
  • 2,388
5 votes
1 answer
1k views

How to run a OpenQASM 3.0 file?

When uploading a QASM-file with ÒPENQASM 3.0; as first line, the code editor on quantum-computing.ibm.com will throw an error. However the qiskit Python library ...
Illuminatio2718's user avatar
0 votes
1 answer
143 views

Odd behavior with Qiskit Pauli operators

I was creating a simple implementation of the Hadamard test when I came across the following, what seems like, strange behavior. Consider the following snippet, which is part of the computating the ...
dylan7's user avatar
  • 324
0 votes
1 answer
484 views

Qiskit implementation for MPS

Now, I'm implementing Matrix product state method with QasmSimulation in Qiskit. following code The problem arise when I set number of qubits. When running it with 27qubits is very fast but, for 24, ...
김동민's user avatar
  • 927
2 votes
1 answer
177 views

Why running time of qasm simulator is significantly smaller in comparison with quantum machines?

I ran a 3-qubit measurement circuit on QASM simulator as well as on IBM Q Melbourne, Santiago and Vigo machines. The running time on the simulator is in few milliseconds (400-800) while in the case of ...
parth's user avatar
  • 305
1 vote
0 answers
71 views

What causes the random variations in the probabilities with respect to the theoretical values, in IBM and QASM simulators?

When I measure 2 and 3 qubits after putting H gate on all of them, there is a variation in probabilities of results in comparison with theoretical values (25% and 12.5%, respectively). This occurs on ...
parth's user avatar
  • 305
0 votes
2 answers
924 views

How to plot histogram using statevector simulator?

I'm trying to run my quantum circuit and plot the simulation result (counts) using the statevector simulator (to avoid 'shot noise'). However, instead of a 2-d histogram, the examples on Qiskit ...
ZR-'s user avatar
  • 2,388
4 votes
1 answer
1k views

Is there any way we get the state vector/density matrix of a noisy simulation in qiskit?

In Qiskit we can't use noise models in the 'state vector_simulator' or the 'unitary simulator', hence making it impossible to compute fidelity of the output of the noisy circuit and the noiseless ...
Pingal Pratyush Nath's user avatar
4 votes
0 answers
62 views

What is the executable opcode for Qiskit quantum hardware, as the quantum circuits or the transpiled/compiled QObj/ QASMQObj are assembly languages? [duplicate]

When we write a QASM code or build quantum circuit on Qiskit GUI, it converts it into QObj/QASMQObj (refering paper Qiskit Backend Specifications for OpenQASM and OpenPulse Experiments) or its ...
Shampa Sarkar's user avatar
1 vote
1 answer
136 views

Is there a standard way to save pulse schedules akin to a qasm for a circuit?

If I create a QuantumCircuit, I can save all the information necessary to reconstruct the circuit using the qasm method. In addition, these qasm strings can be sent directly to the IBM quantum ...
Nic's user avatar
  • 45