valid_stabilizer_state_preparation

guppyft.verify.valid_stabilizer_state_preparation(semantic_function: SemanticStabilizerState | SemanticStabilizerStateDouble, impl_function: ImplementationStabilizerState | ImplementationStabilizerStateDouble, code_definition: StabilizerCode, impl_num_ancillas: int = 0) bool[source]

Checks whether impl_function prepares the state specified by semantic function.

Can check implementations logical Pauli eigenstate preparation

across one or two code blocks.

Parameters:
  • semantic_function – A Guppy function for semantic action of Pauli eigenstate preparation over one or two code blocks.

  • impl_function – A Guppy function for preparing the logical eigenstate over one or two code blocks.

  • code_definition – A stabilizer code with well defined [[n, k, d]] parameters, stabilizer generators and logical operators.

  • impl_num_ancillas – The number of ancilla qubits used in the implementation. Defaults to zero.

Returns:

A Boolean indicating whether the state preparation is valid.