Skip to content

Commit

Permalink
Fix the number of routing qubits in the factories.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElieGouzien committed Aug 30, 2024
1 parent 667c941 commit aa31236
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
13 changes: 8 additions & 5 deletions src/estimates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ impl AliceAndBobEstimates {
#[must_use]
/// Count the number of physical qubits, routing qubits included.
pub fn physical_qubits(&self) -> u64 {
// Routing qubits must be added to ensure all-to-all connectivity
// "Vertical" routing qubits must be added to ensure all-to-all connectivity
// Formula from arXiv: 2302.06639, p. 27. `logical_qubits()` include the "horizontal
// routing qubits".
// routing qubits", including the one between the computation qubits and factories.
let additional_routing_qubits = 2
* ((3 * self.layout_overhead().logical_qubits()
+ self.toffoli_factory_part().map_or(0, FactoryPart::copies) * 6)
* ((3
* (self.layout_overhead().logical_qubits()
+ self.toffoli_factory_part().map_or(0, FactoryPart::copies) * 5))
- 1);
self.0.physical_qubits() + additional_routing_qubits
}
Expand Down Expand Up @@ -111,7 +112,9 @@ impl Display for AliceAndBobEstimates {
writeln!(
f,
"factories distance: {}",
self.toffoli_factory_part().expect("No factory part").factory()
self.toffoli_factory_part()
.expect("No factory part")
.factory()
)?;
writeln!(f, "factory fraction: {:.2}%", self.factory_fraction())?;
writeln!(f, "─────────────────────────────")
Expand Down
12 changes: 9 additions & 3 deletions src/factories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,17 @@ impl estimates::Factory for ToffoliFactory {

/// Number of physical qubits in each factory.
///
/// Each Toffoli factory requires 4 logical qubits, see
/// [arXiv:2302.06639](https://arxiv.org/abs/2302.06639) (p. 27).
/// Each Toffoli factory requires 4 logical qubits + 1 "horizontal" routing qubit,
/// see [arXiv:2302.06639](https://arxiv.org/abs/2302.06639) (p. 27).
/// The routing qubit under the factories is associated with the compute qubits.
///
/// Note that the formula might not be exact when factories internal distance is
/// different than the main code distance, but it is negligeable.
/// Additionnaly, note that that is might not even be a real problem as only one of the 4
/// factory qubit needs to be accessed through all it's physical qubits.
fn physical_qubits(&self) -> u64 {
let num_logical_qubits: u64 = 4;
let horizontal_routing_qubits = num_logical_qubits.div_ceil(4) + 1;
let horizontal_routing_qubits: u64 = 1;

(num_logical_qubits + horizontal_routing_qubits) * (2 * self.code_distance as u64 - 1)
}
Expand Down

0 comments on commit aa31236

Please sign in to comment.