![]() ![]() Though it is freeware, LTspice is not artificially restricted to limit its capabilities (no feature limits, no node limits, no component limits, no subcircuit limits). It is the most widely distributed and used SPICE software in the industry. The statement H q could have been written as h Q without changing the meaning of the statement.LTspice is a SPICE-based analog electronic circuit simulator computer software, produced by semiconductor manufacturer Analog Devices (originally by Linear Technology). This is by convention only, cQASM itself is case-insensitive. Note that the example uses a mix of lower-case and upper-case. First, a Hadamard gate is applied to the qubit with index 0, followed by a CNOT where the qubit with index 0 is the control qubit and the qubit with index 1 is the target qubit.įinally, at line 14 the state of all qubits is measured along the Z-axis to obtain the final result. Line 10 and 11 describe the quantum gates that form the circuit. The detailed SGMQ syntax discusses additional ways of specifying multiple qubits in a single operation. Alternatively, we could have written line 7 as two lines, prep_z q and prep_z q. The Single-Gate Multiple-Qubits (SGMQ) syntax is used to address both qubits at once. Line 7 contains the first quantum instruction, to prepare both qubits in their ground state. For now, just think of sub-circuits as a way of structuring your code. Sub-circuits are discussed in more detail down below. The example defines three sub-circuits: prepare, entangle and measurement. A sub-circuit starts with a dot and the name of the sub-circuit and ends with the definition of another sub-circuit. Lines 6, 9 and 13 mark the beginning of a sub-circuit. When displaying qubits or bits, the (qu)bit with index 0 is the right-most one. The first qubit has index 0 and the second qubit has index 1. Each qubit in the register is identified by its index. In this simple example, two qubits are defined. Line 4 defines the size of the qubit register (and by extension, the size of the corresponding classical register). Use comments to document your code, so that someone else can understand what you were trying to do (note: someone else could also be your future self). Comments start with a hash ( #), and the hash and everything after it until the end of current line is ignored by the cQASM parser. The file starts with the specification of the cQASM version on line 1. Let's start with an example where we create a Bell state to get a feel for the language: In the future, a higher level of abstraction will be required to deal with the billions of qubits needed to make up a practical quantum computer. Whenever this site mentions QASM or cQASM, it is referring to cQASM 1.0 unless explicitly stated otherwise.ĬQASM is used to describe relatively simple circuits, which is fine for the current generation of quantum computers. Many variants of QASM have seen the light since its inception as a mark-up language for generating images. As quantum computation evolved, the language was adopted as a way to specify quantum circuits as input to a quantum computer.Ī QASM program declares the classical bits and qubits, describes the operations (gates) on those qubits and the measurements needed to obtain the classical result by inspecting the qubits. QASM originated as a language for formally defining a quantum circuit to render images for visualization purposes. ![]()
0 Comments
Leave a Reply. |