MarcSerraPeralta / surface-sim

Repository for simulations of surface code experiments
MIT License
0 stars 1 forks source link

Improved generation of detectors for logical gates #42

Closed MarcSerraPeralta closed 1 month ago

MarcSerraPeralta commented 1 month ago

Improve how the detectors are constructed in stim, specially if we want to be able to simulate logical gates with this software.

Some considerations:

Proposed implementation

Create a Detectors class that will be initialized differently for each of the codes by a specific function in each circuit_blocks code. It will be passed to any logical operator, so that the stabilizer generators are updated and it will be also passed to the QEC cycle to generate the detectors. The initialization of the Detectors requires which detector frame to use and if we are using measurement+resets. In every QEC cycle, the previous and current stabilizer generators must be updated. The Detectors class should have the following methods:

TODO

MarcSerraPeralta commented 1 month ago

Regarding how to generate the unitary matrices, I have decided that this information will be stored in the layout file because (for transveral gates) some extra connections are required between qubits. Therefore, thus connections should be specified in the layout. The current idea is to have an extra field for each qubit, log_gates, which will correspond to a dictionary containing all the possible logical gates implemented and the required information to run them. For the case of ancilla qubits, they will store a list of the new_stab_gens, and for the case of data qubits, they will store information of the gates to perform to them (e.g. cz between which qubits, ...)

MarcSerraPeralta commented 1 month ago

This issue can get very big and I believe it would be best to split it into smaller ones and merge small PR. The problem is with the Layout class, because I need to include the log_gates information and generate layouts that have this information.