|
8 | 8 | } |
9 | 9 | }, |
10 | 10 | "source": [ |
11 | | - "# OPTIMIZING MCX GATES - PREPARING FOR FUTURE HARDWARE TODAY\n", |
| 11 | + "# Optimizing MCX Gates, Preparing for Future Hardware Today\n", |
12 | 12 | "\n", |
13 | | - "This note describes how to use the Classiq platform to create MCX gates, including one with 14 controls. Then, it demonstrates a much more complex example with 50 control qubits." |
| 13 | + "This tutorial describes how to use the Classiq platform to create MCX gates, including one with 14 controls. Then, it demonstrates a much more complex example with 50 control qubits." |
14 | 14 | ] |
15 | 15 | }, |
16 | 16 | { |
|
21 | 21 | } |
22 | 22 | }, |
23 | 23 | "source": [ |
24 | | - "## QUANTUM RESOURCES ARE VALUABLE, YET LIMITED\n", |
| 24 | + "## Quantum Resources Are Valuable, Yet Limited\n", |
25 | 25 | "\n", |
26 | | - "Quantum computers offer tantalizing promises to those who can harness their power. And though today’s computers are not quite able to solve real-world problems, those who are able to optimize for the hardware available will be able to reap rewards sooner than those who wait. The MCX gate is an important quantum gate used in a variety of circuits, such as the Grover Operator, logical AND operator, various state preparation algorithms, and arithmetic comparators. The ability to adapt implementations of MCX gates to meet the hardware constraints - limited qubit count, fidelities, gate count, and so on - is not trivial." |
| 26 | + "Quantum computers offer tantalizing promises to those who can harness their power. And although today’s computers are not quite able to solve real-world problems, those who are able to optimize for the available hardware can reap rewards sooner than those who wait. The MCX gate is an important quantum gate used in a variety of circuits, such as the Grover operator, logical AND operator, state preparation algorithms, and arithmetic comparators. The ability to adapt implementations of MCX gates to meet the hardware constraints—limited qubit count, fidelities, gate count, and so on—is not trivial." |
27 | 27 | ] |
28 | 28 | }, |
29 | 29 | { |
|
34 | 34 | } |
35 | 35 | }, |
36 | 36 | "source": [ |
37 | | - "## 1. HOW TO CREATE A 14-CONTROL MCX GATE WITH CLASSIQ\n", |
| 37 | + "## Creating a 14-Control MCX Gate with Classiq\n", |
38 | 38 | "\n", |
39 | | - "To create an MCX gate with 14 control qubits using Classiq, we will first define a quantum function called `my_mcx`, whose arguments are an array of qubits (of any size) to be used as `control`, and a single qubit argument to be used as the `target`. " |
| 39 | + "To create an MCX gate with 14 control qubits using Classiq, we first define a quantum function called `my_mcx` whose arguments are an array of qubits (of any size) for `control` and a single qubit argument for the `target`:" |
40 | 40 | ] |
41 | 41 | }, |
42 | 42 | { |
|
65 | 65 | "cell_type": "markdown", |
66 | 66 | "metadata": {}, |
67 | 67 | "source": [ |
68 | | - "Then, to create an MCX gate with 14 control qubits we will create a quantum `main` function that will simply execute our `my_mcx` function with 14 qubits allocated to the `control` argument. " |
| 68 | + "To create an MCX gate with 14 control qubits, we create a quantum `main` function that executes our `my_mcx` function with 14 qubits allocated to the `control` argument: " |
69 | 69 | ] |
70 | 70 | }, |
71 | 71 | { |
|
85 | 85 | "cell_type": "markdown", |
86 | 86 | "metadata": {}, |
87 | 87 | "source": [ |
88 | | - "To build our model we will use the `create_model` function: " |
| 88 | + "To build our model we use the `create_model` function: " |
89 | 89 | ] |
90 | 90 | }, |
91 | 91 | { |
|
101 | 101 | "cell_type": "markdown", |
102 | 102 | "metadata": {}, |
103 | 103 | "source": [ |
104 | | - "To constrain a circuit to only 20 qubits and optimize for circuit depth, we pass the max width and optimization parameter to a `Constraints` object and update our model" |
| 104 | + "To constrain a circuit to only 20 qubits and optimize for circuit depth, we pass the maximum width and optimization parameter to a `Constraints` object and update our model:" |
105 | 105 | ] |
106 | 106 | }, |
107 | 107 | { |
|
123 | 123 | "cell_type": "markdown", |
124 | 124 | "metadata": {}, |
125 | 125 | "source": [ |
126 | | - "We can now synthesize our model, create a quantum program and view it: " |
| 126 | + "We can now synthesize our model, create a quantum program, and view it: " |
127 | 127 | ] |
128 | 128 | }, |
129 | 129 | { |
|
148 | 148 | "cell_type": "markdown", |
149 | 149 | "metadata": {}, |
150 | 150 | "source": [ |
151 | | - "Additionally, To get the transpiled circuit from our `qprog` object and print its depth: " |
| 151 | + "Additionally, to get the transpiled circuit from our `qprog` object and print its depth: " |
152 | 152 | ] |
153 | 153 | }, |
154 | 154 | { |
|
177 | 177 | } |
178 | 178 | }, |
179 | 179 | "source": [ |
180 | | - "## 2. AN MCX FOR EVERY OCCASION\n", |
| 180 | + "## Optimizing MCX for Every Occasion\n", |
181 | 181 | "\n", |
182 | 182 | "Classiq automatically optimizes the quantum circuit and each MCX gate to a plethora of possible situations. To characterize each setting we pass our constraints and preferences to the synthesis request using the `Constraints` and `Preferences` objects." |
183 | 183 | ] |
|
190 | 190 | } |
191 | 191 | }, |
192 | 192 | "source": [ |
193 | | - "### 2.1 OPTIMIZING FOR DIFFERENT HARDWARE" |
| 193 | + "### For Different Hardware" |
194 | 194 | ] |
195 | 195 | }, |
196 | 196 | { |
|
244 | 244 | } |
245 | 245 | }, |
246 | 246 | "source": [ |
247 | | - "### 2.2 OPTIMIZING FOR CX GATES" |
| 247 | + "### For CX Gates" |
248 | 248 | ] |
249 | 249 | }, |
250 | 250 | { |
|
297 | 297 | } |
298 | 298 | }, |
299 | 299 | "source": [ |
300 | | - "## 3. BEYOND 14 CONTROLS\n", |
| 300 | + "## Beyond 14 Controls\n", |
301 | 301 | "\n", |
302 | | - "The power of the Classiq synthesis engine is far greater than creating optimized, 14-control MCX gates in an instant. Take the following code, where we create an MCX gate with 50 control qubits." |
| 302 | + "The power of the Classiq synthesis engine is far greater than creating optimized, 14-control MCX gates in an instant. For example, the following code creates an MCX gate with 50 control qubits:" |
303 | 303 | ] |
304 | 304 | }, |
305 | 305 | { |
|
0 commit comments