DataBlock#
qualtran.surface_code.DataBlock
View source on GitHub
|
Methods for modeling the costs of the data block of a surface code compilation.
The number of algorithm qubits is reported by Qualtran as a logical cost of a bloq. The surface code is a rate-1 code, so each bit of data needs at least one surface code tile. Due to locality constraints imposed by the 2D surface code combined with the need to interact qubits that aren’t necessarily local, additional tiles are needed to actually execute a program.
Each data block is responsible for reporting the number of tiles required to store a certain number of algorithm qubits; as well as the number of time steps required to consume a magic state. Different data blocks exist in the literature, and data block provides a different space-time tradeoff.
The space occupied by the data block is to be contrasted with the space used for magic state distillation.
Attributes
data_dThe code distance used to store the data in the data block.
n_steps_to_consume_a_magic_stateThe number of surface code steps to consume a magic state.
We must teleport in “magic states” to do non-Clifford operations on our algorithmic data qubits. The layout of the data block can limit the number magic states consumed per unit time.
One surface code step is
data_dcycles of error correction.DataBlock imlpementation must override this method. This method is used by
self.n_cyclesto report the total number of cycles required.
Methods#
n_tiles
@abc.abstractmethodn_tiles( n_algo_qubits: int ) -> int
The number of surface code tiles used to store a given number of algorithm qubits.
We define an “algorithm qubit” to be a qubit used in the routing of algorithm-relevant quantum data in a bloq. A physical qubit is a physical system that can encode one qubit, albeit noisily. Specific to the surface code, we define a “tile” to be the minimal area of physical qubits necessary to encode one logical qubit to a particular code distance. A tile can store an algorithm qubit, can be used for ancillary purposes like routing, or can be left idle. A tile is usually a square grid of \(2d^2\) physical qubits.
DataBlock implementations must override this method. This method is used by
self.n_phys_qubits to report the total number of physical qubits.
Args
n_algo_qubitsThe number of algorithm qubits to compute the number of tiles for.
Returns
n_cycles
n_cycles(
n_logical_gates: 'GateCounts', logical_error_model: 'LogicalErrorModel'
) -> int
The number of surface code cycles to apply the number of gates to the data block.
Note that only the Litinski (2019) derived data blocks model a limit on the number of magic states consumed per step. Other data blocks return “zero” for the number of cycles due to the data block. When using those data block designs, it is assumed that the number of cycles taken by the magic state factories is the limiting factor in the computation.
n_physical_qubits
n_physical_qubits(
n_algo_qubits: int
) -> int
The number of physical qubits used by the data block.
data_error
data_error(
n_algo_qubits: int, n_cycles: int, logical_error_model: 'LogicalErrorModel'
) -> float
The error associated with storing data on n_algo_qubits for n_cycles.
View source on GitHub