Quantum Computation Language

Uses your system voice; voice and rate in settings.

Snapshot

≈ 3 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Quantum Computation Language (QCL) is one of the first implemented quantum programming languages. The most important feature of QCL is the support for user-defined operators and functions. Its syntax resembles the syntax of the C programming language and its classical data types are similar to primitive data types in C. One can combine classical code and quantum code in the same program.

How it works

The language was created before there were multi-qubit quantum computers and the only implementation of QCL uses an interpreter with a built-in classically simulated quantum computer. QCL was created to explore programming concepts for quantum computers.

The QCL library provides standard quantum operators used in quantum algorithms such as: * Controlled-not with many target qubits, * Hadamard operation on many qubits, * Phase and controlled phase. * Quantum algorithms for addition, multiplication and exponentiation with binary constants (all modulus n) * The quantum fourier transform

Evidence and sources

Quantum Computation Language (QCL) is one of the first implemented quantum programming languages. The most important feature of QCL is the support for user-defined operators and functions. Its syntax resembles the syntax of the C programming language and its classical data types are similar to primitive data types in C. One can combine classical code and quantum code in the same program.

The language was created before there were multi-qubit quantum computers and the only implementation of QCL uses an interpreter with a built-in classically simulated quantum computer. QCL was created to explore programming concepts for quantum computers. The QCL library provides standard quantum operators used in quantum algorithms such as: Controlled-not with many target qubits, Hadamard operation on many qubits, Phase and controlled phase.

Quantum algorithms for addition, multiplication and exponentiation with binary constants (all modulus n) The quantum fourier transform qureg x1[2]; // 2-qubit quantum register x1 qureg x2[2]; // 2-qubit quantum register x2 H(x1); // Hadamard operation on x1 H(x2[1]); // Hadamard operation on the first qubit of the register x2 Since the qcl interpreter uses qlib simulation library, it is possible to observe the internal state of the quantum machine during execution of the quantum program. qcl> dump STATE: 4 / 32 qubits allocated, 28 / 32 qubits free 0.35355 |0> + 0.35355 |1> + 0.35355 |2> + 0.35355 |3> + 0.35355 |8> + 0.35355 |9> + 0.35355 |10> + 0.35355 |11> Note that the dump operation is different from measurement, since it does not influence the state of the quantum machine and can be realized only using a simulator.

Like in modern programming languages, it is possible to define new operations which can be used to manipulate quantum data. For example: operator diffuse (qureg q) { H(q); // Hadamard Transform Not(q); // Invert q CPhase(pi, q); // Rotate if q=1111.. !Not(q); // undo inversion !H(q); // undo Hadamard Transform } defines inverse about the mean operator used in Grover's algorithm (it is sometimes called Grover's diffusion operator).

This allows one to define algorithms on a higher level of abstraction and extend the library of functions available for programmers.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1369613723 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot enwiki-001369613723 · captured 1786837986.0 · version history

Cite this page as: encyclopegia.org, “Quantum Computation Language”, snapshot enwiki-001369613723. https://encyclopegia.org/a/quantum-computation-language

Sources cited in this revision

4 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.