From 46259bbbb772fe3ac3f87f6569c8502b4f1925ce Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Mon, 20 May 2024 07:57:49 -0400 Subject: [PATCH 1/2] Move standard gates first --- docs/build/circuit-library.ipynb | 103 +++++++++++++++---------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/docs/build/circuit-library.ipynb b/docs/build/circuit-library.ipynb index 07072ca7fc0..493edaadc9e 100644 --- a/docs/build/circuit-library.ipynb +++ b/docs/build/circuit-library.ipynb @@ -19,6 +19,57 @@ "This page lists the different circuit categories the library provides. For a full list of circuits, see the [circuit library API documentation](/api/qiskit/circuit_library)." ] }, + { + "cell_type": "markdown", + "id": "0b473350", + "metadata": {}, + "source": [ + "## Standard gates\n", + "\n", + "The circuit library also includes standard quantum gates. Some are more fundamental gates (such as the `UGate`), and others are multi-qubit gates that usually need building from single- and two-qubit gates. To add imported gates to your circuit, use the `append` method; the first argument is the gate, and the next argument is a list of qubits to apply the gate to.\n", + "\n", + "For example, the following code cell creates a circuit with a Hadamard gate and a multi-controlled-X gate." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "70a7a4df", + "metadata": {}, + "outputs": [ + { + "data": { + "image/svg+xml": [ + "" + ], + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from qiskit import QuantumCircuit\n", + "from qiskit.circuit.library import HGate, MCXGate\n", + "mcx_gate = MCXGate(3)\n", + "hadamard_gate = HGate()\n", + "\n", + "qc = QuantumCircuit(4)\n", + "qc.append(hadamard_gate, [0])\n", + "qc.append(mcx_gate, [0,1,2,3])\n", + "qc.draw('mpl')" + ] + }, + { + "cell_type": "markdown", + "id": "e5066595", + "metadata": {}, + "source": [ + "See [Standard gates](/api/qiskit/circuit_library#standard-gates) in the circuit library API documentation." + ] + }, { "cell_type": "markdown", "id": "f1d7c8c9-1b4d-45e1-9cd5-c5d76c2e25ab", @@ -389,58 +440,6 @@ "See [Arithmetic circuits](/api/qiskit/circuit_library#arithmetic-circuits) in the circuit library API documentation." ] }, - { - "cell_type": "markdown", - "id": "ee5a64f5-1316-4217-a443-f09cb6d35c19", - "metadata": {}, - "source": [ - "## Standard gates\n", - "\n", - "The circuit library also includes standard quantum gates. Some are more fundamental gates (such as the `UGate`), and others are multi-qubit gates that usually need building from single- and two-qubit gates. To add imported gates to your circuit, use the `append` method; the first argument is the gate, and the next argument is a list of qubits to apply the gate to.\n", - "\n", - "For example, the following code cell creates a circuit with a Hadamard gate and a multi-controlled-X gate." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "a846a845-7ac5-4c92-b124-d2b90a773ba2", - "metadata": {}, - "outputs": [ - { - "data": { - "image/svg+xml": [ - "" - ], - "text/plain": [ - "
" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "from qiskit import QuantumCircuit\n", - "from qiskit.circuit.library import HGate, MCXGate\n", - "mcx_gate = MCXGate(3)\n", - "hadamard_gate = HGate()\n", - "\n", - "qc = QuantumCircuit(4)\n", - "qc.append(hadamard_gate, [0])\n", - "qc.append(mcx_gate, [0,1,2,3])\n", - "qc.draw('mpl')" - ] - }, - { - "cell_type": "markdown", - "id": "d6c33a70", - "metadata": {}, - "source": [ - "See [Standard gates](/api/qiskit/circuit_library#standard-gates) in the circuit library API documentation." - ] - }, { "cell_type": "markdown", "id": "9a900a84-c52f-4a03-b3e9-87c71fa93e88", From dd8922bf6024b2cee9d7fd0049b7517ea0b8603b Mon Sep 17 00:00:00 2001 From: abbycross Date: Mon, 20 May 2024 10:01:47 -0400 Subject: [PATCH 2/2] CI fix Co-authored-by: Frank Harkins --- docs/build/circuit-library.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build/circuit-library.ipynb b/docs/build/circuit-library.ipynb index 493edaadc9e..0c4496897bf 100644 --- a/docs/build/circuit-library.ipynb +++ b/docs/build/circuit-library.ipynb @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "70a7a4df", + "id": "a846a845-7ac5-4c92-b124-d2b90a773ba2", "metadata": {}, "outputs": [ {