Skip to content

Commit

Permalink
Ac/dta2 350 small footprint factories (#152)
Browse files Browse the repository at this point in the history
* feat: added small footprint factories

* fix: improperly labeled factories

* fix: Allowed physical error rate is set

* fix: clarify factory optimizations

* fix: mypy issues
  • Loading branch information
Athena Caesura authored May 7, 2024
1 parent 5f78b9a commit 01970f7
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/ex_6_orquestra_customized/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
To run this on Orquestra or locally use ``run.py`` script in the same directory.
"""

from dataclasses import replace
from typing import List

Expand Down Expand Up @@ -98,7 +99,7 @@ def estimate_resources(


@sdk.workflow(resources=sdk.Resources(memory="8Gi", nodes=2))
def estimation_workflow() -> List[GraphResourceInfo]:
def estimation_workflow() -> List[sdk.ArtifactFuture[GraphResourceInfo]]:
"""The workflow for estimating resources.
The workflow does the following:
Expand Down
4 changes: 4 additions & 0 deletions src/benchq/magic_state_distillation/litinski_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
def iter_litinski_factories(
architecture_model: BasicArchitectureModel,
) -> Iterable[MagicStateFactory]:
"""
An iterator which yields magic state factories which are optimized in order
to minimize the space time volume.
"""
assert architecture_model.physical_qubit_error_rate in _ALLOWED_PHYSICAL_ERROR_RATES

return _ERROR_RATE_FACTORY_MAPPING[architecture_model.physical_qubit_error_rate]
79 changes: 79 additions & 0 deletions src/benchq/magic_state_distillation/small_footprint_factories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
from typing import Iterable

from benchq.quantum_hardware_modeling.hardware_architecture_models import (
BasicArchitectureModel,
)

from .magic_state_factory import MagicStateFactory

_ALLOWED_PHYSICAL_ERROR_RATES = {1e-5}

_ERROR_RATE_FACTORY_MAPPING = {
1e-5: (
MagicStateFactory("small footprint (15-to-1)_3,1,1", 1.8e-06, (6, 7), 86, 12.1),
MagicStateFactory(
"small footprint (15-to-1)_5,1,3", 7.8e-09, (10, 9), 186, 37.3
),
MagicStateFactory(
"small footprint (15-to-1)_7,3,3", 5.5e-12, (14, 19), 538, 36.0
),
MagicStateFactory(
"small footprint (15-to-1)_9,3,3", 3.2e-14, (18, 21), 762, 36.0
),
MagicStateFactory(
"small footprint (15-to-1)_5,1,1 x (20-to-4)_11,3,5",
6.7e-15,
(37, 22),
1462,
150.0,
),
MagicStateFactory(
"small footprint (15-to-1)_5,1,3 x (20-to-4)_11,3,5",
1.4e-16,
(43, 22),
1614,
275.1,
),
MagicStateFactory(
"small footprint (15-to-1)_5,1,1 x (20-to-4)_11,5,5",
1.3e-17,
(51, 22),
1958,
150.0,
),
MagicStateFactory(
"small footprint (15-to-1)_5,1,1 x (20-to-4)_13,5,5",
1.8e-20,
(51, 22),
2350,
150.0,
),
MagicStateFactory(
"small footprint (15-to-1)_5,1,3 x (20-to-4)_15,5,5",
2.7e-22,
(55, 30),
2782,
275.0,
),
MagicStateFactory(
"small footprint (15-to-1)_5,1,3 x (20-to-4)_15,5,5",
3.8e-23,
(63, 30),
3190,
276.8,
),
),
}


def iter_small_footprint_factories(
architecture_model: BasicArchitectureModel,
) -> Iterable[MagicStateFactory]:
"""
An iterator which yields magic state factories which are optimized in order
to minimize the number of physical qubits.
"""

assert architecture_model.physical_qubit_error_rate in _ALLOWED_PHYSICAL_ERROR_RATES

return _ERROR_RATE_FACTORY_MAPPING[architecture_model.physical_qubit_error_rate]

0 comments on commit 01970f7

Please sign in to comment.