Skip to content

Add qdk.ec module - #3602

Draft
orpuente-MS wants to merge 25 commits into
mainfrom
oscarpuente/qdk-ec
Draft

Add qdk.ec module#3602
orpuente-MS wants to merge 25 commits into
mainfrom
oscarpuente/qdk-ec

Conversation

@orpuente-MS

@orpuente-MS orpuente-MS commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This PR adds the qdk.ec module.

Relevant changes:

  • It preserves the established qdk.ec authoring, profiling, and testing entry points from the prototype while simplifying their implementation.
  • Temporarily removes the experimental qdk.ec.targets submodule and ec-backends extra.
  • Adds experimental qodec_from_code function.
  • Scopes lint phase gating to the affected artifact.
  • Consolidates gadget semantics on CircuitAction.
  • Logical-coordinate handling is centralized to support symbolic, output-only, and multi-logical-qubit programs consistently.

Summary of the public API:

qdk.ec.load_yaml
qdk.ec.save_yaml
qdk.ec.from_yaml
qdk.ec.to_yaml

qdk.ec.complete_qodec
qdk.ec.complete_gadget
qdk.ec.qodec_from_code

qdk.ec.action
qdk.ec.action.declared_action_of
qdk.ec.action.realized_action_of
qdk.ec.action.gadget_action_mismatch
qdk.ec.action.input_qubits_of

qdk.ec.checks
qdk.ec.checks.checks_of
qdk.ec.checks.essential_checks_of
qdk.ec.checks.outcome_code_of
qdk.ec.checks.profile_of

qdk.ec.code
qdk.ec.code.encoding_clifford_of
qdk.ec.code.gauge_basis_of
qdk.ec.code.logical_effect_of
qdk.ec.code.syndrome_of
qdk.ec.code.codes_equivalent

qdk.ec.distance
qdk.ec.distance.code_distance_of
qdk.ec.distance.code_distance_bounds_of

qdk.ec.equivalence
qdk.ec.equivalence.codes_equivalent
qdk.ec.equivalence.gadgets_equivalent
qdk.ec.equivalence.why_not_equivalent
qdk.ec.equivalence.actions_equivalent_mod_pauli
qdk.ec.equivalence.actions_outcome_equivalent

qdk.ec.faults
qdk.ec.faults.fault_profile_of
qdk.ec.faults.fault_effects_of

qdk.ec.readouts
qdk.ec.readouts.profile_of
qdk.ec.readouts.outcome_profile_of
qdk.ec.readouts.outcomes_flipped_by_anti_observables_of

…shape logic in qdk.ec

- remove inert block_operands threading and test-only validators from production
- one Pauli-term parser and typed code helpers replace six duplicates
- block_stride returns the single stride used, raising on multi-width ISAs
- split declared vs derived gauge; dispatch audit rules by isinstance
- add `_operands`
- drop `_typed_ir`
- add `declared_pauli_of` / `logical_pauli_of`
- derive the observable/flag readout split once via `readouts_of`
- fix `StimEmitter._recursive` typo that broke `RecursiveTarget` at runtime
…lize lint gating per target, remove synthesis token probing, and structure expected omissions while propagating unexpected failures.
maximum_weight
)
)
decoder = BasicLookupDecoder.from_code(code, errors=errors) # type: ignore[name-defined] # TODO: BasicLookupDecoder import is commented out; this helper is broken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants