Automatic Registers Resolution¶
The Classiq engine supports the automatic merging of registers. This means that the circuit opens with all the known registers already collapsed. This feature completes the manual feature.
Introduction¶
Each function contains information on its registers, which is mainly provided by the Classiq synthesis engine. The information includes the register type (input, output, zero, auxiliary), the name, and the qubits it contains.
You can get information about the function's registers by clicking the function and looking in the Information tab.
Screenshots on this page come from this example:
from classiq import Model, RegisterUserInput
from classiq.builtin_functions import Arithmetic
params = Arithmetic(
expression="(a + b + c & 15) % 8 ^ 3 & a ^ 10 ^ d == 4",
definitions=dict(
a=RegisterUserInput(size=2, is_signed=False),
b=RegisterUserInput(size=2),
c=RegisterUserInput(size=3),
d=RegisterUserInput(size=1),
),
uncomputation_method="optimized",
qubit_count=25,
)
model = Model()
model.Arithmetic(params)
circuit = model.synthesize()
circuit.show()
Wire Merging Criteria¶
Two or more wires can be merged only if:
- The wire's source and destination are the same gates.
- The wires operate on sequential qubits. For example, a register merges if the wires are between qubits 4, 5, and 6, but a register with wires on qubits 1, 4, and 5 does not merge.
Input Registers¶
Currently, the Classiq platform only supports input registers. To see if a register is an input register, look in the Information tab.
If a gate's input register meets the merge criteria, wires are automatically merged when a circuit loads. Output registers may be supported in future Classiq versions.
Visual cues:
- label - a label appears on the right of the wire next to the gate (left of the gate), containing the register's name
- color - wires are color-coded as described below
If the engine cannot merge wires, it displays them separately.
Special registers:
- Zero - A register that always contains the |0⟩ state appears with the color green
- Auxiliary - A register that is used as a helper to a function appears with the color red
Disclaimer¶
This is an experimental feature. Your feedback is appreciated.