Skip to content

refactor!: make ancillas argument optional, rename to n_impl_ancillas - #412

Merged
CalMacCQ merged 6 commits into
mainfrom
cm/minimal_breaking_ancillas_change
Sep 17, 2026
Merged

CalMacCQ merged 6 commits into
mainfrom
cm/minimal_breaking_ancillas_change

Conversation

@CalMacCQ

@CalMacCQ CalMacCQ commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

This PR splits off the breaking change from #328 so we can release 0.2 without waiting for the issues with that PR to be resolved.

BREAKING CHANGE:

  • The n_ancillas arg to valid_stabilizer_state_preparation and valid_clifford_implementation is renamed to n_impl_ancillas to emphasise that ancillas only really make sense in the impl_function
  • This same argument is now of type int | None (None by default) rather than int (0 by default)

@CalMacCQ
CalMacCQ requested a review from a team as a code owner September 17, 2026 15:12
@github-actions

Copy link
Copy Markdown

This PR contains breaking changes to the public Python API.

Breaking changes summary
src/guppyft/verify/_verify.py:495: valid_clifford_implementation(n_ancillas):
Parameter was removed

src/guppyft/verify/_verify.py:328: valid_stabilizer_state_preparation(n_ancillas):
Parameter was removed


# Get the k stabilizers for the k qubit state.
semantic_stabilizers = _compute_stabilizers_single_block_state(
semantic_function, # type: ignore[arg-type]
code_definition.n_logical_qubits + n_ancillas,

@CalMacCQ CalMacCQ Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This n_ancillas arg should not actually have been passed here. Ancillas only make sense for the simulation with the impl_function. I'll link a thread that explains this.

@CalMacCQ
CalMacCQ requested a review from hsemenenko September 17, 2026 15:30
@CalMacCQ
CalMacCQ merged commit f5e24f4 into main Sep 17, 2026
20 of 21 checks passed
@CalMacCQ
CalMacCQ deleted the cm/minimal_breaking_ancillas_change branch September 17, 2026 15:47
@hugrbot hugrbot mentioned this pull request Sep 17, 2026
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