### Draw Simple Teleportation Quantum Circuit in LaTeX Source: https://github.com/projekter/yquant/blob/master/README.md This example demonstrates a basic quantum teleportation circuit using yquant. It initializes three qubits, applies Hadamard and CNOT gates for entanglement, performs CNOT and Hadamard gates on the message qubit, measures the first two qubits, and then applies Z and X corrections based on the measurement outcomes. ```LaTeX \begin{tikzpicture} \begin{yquant} qubit {$\ket{\reg_{\idx}}$} q[3]; h q[1]; cnot q[2] | q[1]; cnot q[1] | q[0]; h q[0]; measure q[0-1]; z q[2] | q[1]; x q[2] | q[0]; \end{yquant} \end{tikzpicture} ``` -------------------------------- ### Multi-Controlled Quantum Gates in yquant LaTeX Source: https://github.com/projekter/yquant/blob/master/README.md This LaTeX code illustrates the implementation of quantum circuits with multiple control qubits using the yquant package. It shows examples of ZZ gates, CNOT, Hadamard with controls, measurement, and a generic unitary box with controls. ```LaTeX \begin{tikzpicture} \begin{yquant*} zz (a[0, 2]); cnot a[1] ~ a[0]; zz (a[2, 3]); h a[3] | a[0] ~ a[1]; measure a[2, 3]; box {$U$} (a[0, 1]) | a[3] ~ a[2]; discard a[2, 3]; \end{yquant*} \end{tikzpicture} ``` -------------------------------- ### Draw Three-Qubit FT QEC Circuit with Syndrome Measurement in LaTeX Source: https://github.com/projekter/yquant/blob/master/README.md This example demonstrates a three-qubit fault-tolerant quantum error correction (QEC) circuit, including syndrome measurement. It sets up qubits and classical bits, performs entanglement and CNOT operations for syndrome extraction, measures ancilla qubits, and then applies classical corrections and a recovery operation based on the measured syndrome. ```LaTeX \begin{tikzpicture} \begin{yquant} qubit {$\ket{q_{\idx}}$} q[3]; qubit {$\ket{s_{\idx}} = \ket0$} s[2]; cbit {$c_{\idx} = 0$} c[2]; h s[0]; cnot s[1] | s[0]; cnot s[0] | q[0]; cnot s[1] | q[1]; cnot s[1] | s[0]; h s[0]; measure s; cnot c[0] | s[0]; cnot c[1] | s[1]; discard s; init {$\ket0$} s; h s[0]; cnot s[1] | s[0]; cnot s[0] | q[1]; cnot s[1] | q[2]; cnot s[1] | s[0]; h s[0]; measure s; box {Process\\Syndrome} (s, c); box {$\mathcal R$} (q) | s, c; \end{yquant} \end{tikzpicture} ``` -------------------------------- ### Quantum Circuit Equivalences in yquant LaTeX Source: https://github.com/projekter/yquant/blob/master/README.md This LaTeX code demonstrates how to represent quantum circuit equivalences using the yquantgroup environment in the yquant package. It shows two equivalent circuits, one with H-CNOT-H and another with a single CNOT. ```LaTeX % \useyquantlanguage{groups} \begin{tikzpicture} \begin{yquantgroup} \registers{ qubit {} q[2]; } \circuit{ h -; cnot q[1] | q[0]; h -; } \equals \circuit{ cnot q[0] | q[1]; } \end{yquantgroup} \end{tikzpicture} ``` -------------------------------- ### Draw Three-Qubit Phase Estimation Circuit in LaTeX Source: https://github.com/projekter/yquant/blob/master/README.md This snippet illustrates a three-qubit quantum phase estimation circuit, incorporating Quantum Fourier Transform (QFT) and controlled-U gates. It initializes ancilla qubits in superposition, applies controlled-U operations with varying powers, and then performs the inverse QFT (represented by Hadamard and controlled-phase gates) to extract the phase. ```LaTeX \begin{tikzpicture} \begin{yquant} qubit {$\ket{j_{\idx}} = \ket0$} j[3]; qubit {$\ket{s_{\idx}}$} s[2]; h j; box {$U^4$} (s) | j[0]; box {$U^2$} (s) | j[1]; box {$U$} (s) | j[2]; h j[0]; box {$S$} j[1] | j[0]; h j[1]; box {$T$} j[2] | j[0]; box {$S$} j[2] | j[1]; h j[2]; measure j; \end{yquant} \end{tikzpicture} ``` -------------------------------- ### Quantum Error Correction Circuit in yquant LaTeX Source: https://github.com/projekter/yquant/blob/master/README.md This LaTeX code defines a quantum circuit for error correction using the yquant package. It includes a syndrome measurement subcircuit and a recovery box, demonstrating how to represent quantum error correction codes. ```LaTeX % \usetikzlibrary{quotes} \begin{tikzpicture} \begin{yquant} qubit {} msg[3]; nobit syndrome[3]; [this subcircuit box style={dashed, "Syndrome Measurement"}] subcircuit { qubit {} msg[3]; [out] qubit {$\ket0$} syndrome[3]; cnot syndrome[0] | msg[0]; cnot syndrome[0] | msg[1]; cnot syndrome[1] | msg[1]; cnot syndrome[1] | msg[2]; cnot syndrome[2] | msg[0]; cnot syndrome[2] | msg[2]; dmeter {$M_{\symbol{\numexpr`a+\idx}}$} syndrome; } (msg[-2], syndrome[-2]); ["Recovery"] box {$\mathcal R$} (msg) | syndrome; discard syndrome; \end{yquant} \end{tikzpicture} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.