Neutral Atom Logical State PreparationΒΆ
All quantum computers are prone to errors. This is the motivation of employing error correction during a quantum computation. To this end, a (logical) qubit on the algorithmic level is encoded into a shared and highly entangled state of multiple physical qubits. Before the actual computation can start, those physical qubits need to be prepared in a state that represents the logical zero state.
For that, we provide a tool based on [6] that takes a state preparation circuit and generates an optimal sequence of operations tailored to the zoned neutral atom architecture. Thereby, the circuit consists of one initial layer of Hadamard gates on all qubits that initialize the physical qubits in the plus state. Those are followed by a set of entangling (CZ) gates that generate a so-called graph state. The final logical state is achieved by applying additional Hadamard gates on selected qubits.
Below we demonstrate how the optimal schedule can be retrieved for the Steane-code, the smallest 2D color code.
First, we create the state preparation circuit for the Steane-code as a qiskit.QuantumCircuit.
1from qiskit import QuantumCircuit
2
3qc = QuantumCircuit(7)
4qc.h(range(7))
5qc.cz(0, 3)
6qc.cz(0, 4)
7qc.cz(1, 2)
8qc.cz(1, 5)
9qc.cz(1, 6)
10qc.cz(2, 3)
11qc.cz(2, 4)
12qc.cz(3, 5)
13qc.cz(4, 6)
14qc.h(0)
15qc.h(2)
16qc.h(5)
17qc.h(6)
18
19qc.draw(output="mpl")
We solve the problem of optimal state preparation with an SMT solver (Z3). Therefore, we encode the problem into an SMT-model. To construct the SMT model, the solver takes the entangling operations (CZ) as a list of qubit pairs.
1from mqt.core import load
2from mqt.qmap.na.state_preparation import get_ops_for_solver
3
4circ = load(qc)
5ops = get_ops_for_solver(circ, "z", 1) # We extract the 'Z' gates with '1' control, i.e., CZ gates
6ops
[(0, 3), (0, 4), (1, 2), (1, 5), (1, 6), (2, 3), (2, 4), (3, 5), (4, 6)]
Now, we are ready to initialize the solver and to generate the optimal sequence of operations. The parameters of the solver describe an architecture with two storage zones with each two rows, one zone above the entangling zone and one below. The entangling zone itself consists of three rows and the architecture model has three columns. Within each interaction site, atoms can be offset by two sites in every direction. The considered architecture offers two AOD columns and three AOD rows.
We instruct the solver to generate a sequence consisting of four stages. Thereby, we do not fix the number of transfer stages. The last two boolean arguments, specify that the solver needs not to maintain the order of operations and must shield idling qubits in the storage zone. For further details on the employed abstraction of the 2D plane in the solver, please refer to the corresponding article [6].
1from mqt.qmap.na.state_preparation import NAStatePreparationSolver
2
3solver = NAStatePreparationSolver(3, 7, 2, 3, 2, 2, 2, 2, 2, 4)
4result = solver.solve(ops, 7, 4, None, False, True)
To inspect the result, it can be exported to the human-readable JSON format by invoking the method result.json()
In this example, we take another approach and generate code from the result.
For that, we call the function generate_code with the respective arguments.
1from mqt.qmap.na.state_preparation import generate_code
2
3code = generate_code(circ, result)
4print(code)
atom (14.000, 38.000) atom4
atom (14.000, 54.000) atom2
atom (15.000, 39.000) atom6
atom (15.000, 54.000) atom1
atom (15.000, 68.000) atom5
atom (16.000, 68.000) atom3
atom (16.000, 90.000) atom0
@+ load [
atom0
atom1
atom2
atom3
atom5
atom6
]
@+ ry 1.57080 global
@+ cz zone_cz0
@+ move [
(42.000, 39.000) atom0
(26.000, 37.000) atom1
(14.000, 37.000) atom2
(42.000, 38.000) atom3
(26.000, 38.000) atom5
(26.000, 13.000) atom6
]
@+ cz zone_cz0
@+ move [
(28.000, 66.000) atom0
(26.000, 36.000) atom1
(14.000, 36.000) atom2
(28.000, 52.000) atom3
(26.000, 52.000) atom5
(26.000, 0.000) atom6
]
@+ store [
atom0
atom3
]
@+ load atom4
@+ move [
(42.000, 52.000) atom1
(29.000, 52.000) atom2
(29.000, 66.000) atom4
(42.000, 89.000) atom5
(42.000, 51.000) atom6
]
@+ cz zone_cz0
@+ ry -0.78540 global
@+ rz 3.14159 atom2
@+ rz 3.14159 atom6
@+ rz 3.14159 atom0
@+ rz 3.14159 atom5
@+ ry 0.78540 global