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
1 vote
1 answer
194 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
  • 11
1 vote
2 answers
134 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
51 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,172
1 vote
2 answers
113 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,172
2 votes
1 answer
121 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
3 votes
0 answers
26 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
121 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
171 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
1 vote
3 answers
348 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
  • 37
1 vote
0 answers
145 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
65 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
2k 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
856 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
2 votes
1 answer
224 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
215 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
142 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
117 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,348
1 vote
2 answers
88 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,348
3 votes
1 answer
722 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
164 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
53 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 ...
Sarika Singh's user avatar
2 votes
1 answer
181 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
  • 254
3 votes
1 answer
215 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
211 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
251 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
148 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
  • 97
2 votes
1 answer
934 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
265 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
169 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
105 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
42 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,348
1 vote
1 answer
103 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,348
5 votes
1 answer
827 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
129 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
  • 314
0 votes
1 answer
248 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
  • 837
2 votes
1 answer
144 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
59 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
595 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,348
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
61 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
113 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
2 votes
0 answers
104 views

Post-selection in QASM

In some quantum algorithms (for example HHL or quantum machine learning algorithms) an ancilla qubit(s) is measured firstly and based on result of the measurement other qubit(s) are measured or not. ...
Martin Vesely's user avatar
1 vote
1 answer
100 views

Problem with comments and code rearranging in IBM Q web interface

I wrote some code in QASM in the IBM Q Experience web interface and then I added some comments. After that I saved the code and run it. However, the code was rearranged (for example some gates were ...
Martin Vesely's user avatar
1 vote
1 answer
792 views

How can I install the 'ibmq_qasm_simulator' backend?

I'm having trouble running the following cell: The system told me "The 'ibmq_qasm_simulator' backend is not installed in your system." I'm so confused. Is there a way I can install this backend in my ...
ZR-'s user avatar
  • 2,348
0 votes
2 answers
163 views

How to stop optimization of a circuit during transpiling in web-interface of IBM Q?

I was playing with approximation of gates with Clifford+T group on IBM Q. Everything works well on simulator, however, when I tried to run my circuit on actual quantum processor, a transpiler ...
Martin Vesely's user avatar
1 vote
1 answer
52 views

Who cares about Transpiled Circuit Text? [duplicate]

At any result of a job in this last version of the Circuit Composer, at the OpenQasm tab inside the Circuit Diagram, I am unable to use the tradicional copy or ctrl-c to get the transpiled circuit ...
Bruno's user avatar
  • 41
1 vote
2 answers
78 views

Subroutines on IBM Q (ERROR_RUNNING_JOB returned)

I wrote following code in QASM editor on IBM Q web interface (note ccu1 is controlled-controlled U1 gate): ...
Martin Vesely's user avatar
1 vote
0 answers
295 views

Error when running an algorithm on real device at IBM Q using QASM

I'm running an algorithm on a real quantum device from IBM (ibmqx2), using the QASM and circuit composer, and it just gets the same error over and over again: ...
doomsk's user avatar
  • 11
0 votes
1 answer
217 views

Implementing U2-Gates on Cirq

I am interested in using the QASM2Cirq methods to make this gate: u2(0, np.pi, q[0]). How can I build that object using Cirq rather than QASM string value passed onto cirq.
Enrique Segura's user avatar
2 votes
1 answer
556 views

How can I use IF gate in IBM Q composer?

I just want to use the "if" gate in IBM QX circuit composer, but I don't know how.
Ramin's user avatar
  • 21