Skip to content

Release 0.3.2

Latest
Compare
Choose a tag to compare
@shinich1 shinich1 released this 18 Aug 11:37
· 5 commits to master since this release
19dfbc5

[0.3.2] - 2025-08-12

Added

  • #320: Method for Pattern: compose

  • #310: Method for OpenGraph: compose

  • #277: Methods for pretty-printing Pattern: to_ascii,
    to_unicode, to_latex.

  • #300: Branch selection in simulation: in addition to
    RandomBranchSelector which corresponds to the strategy that was
    already implemented, the user can use FixedBranchSelector,
    ConstBranchSelector, or define a custom branch selection by
    deriving the abstract class BranchSelector.

  • #312: The separation between TensorNetworkBackend and backends
    that operate on a full-state representation, such as
    StatevecBackend and DensityMatrixBackend, is now clearer with
    the introduction of the abstract classes DenseStateBackend and
    DenseState, which derive from Backend and BackendState,
    respectively. StatevecBackend and DensityMatrixBackend inherit
    from DenseStateBackend, while Statevec and DensityMatrix
    inherit from DenseState. Note that the class hierarchy of
    BackendState mirrors that of Backend.

  • #322: Added a new optimization module containing:

    • a functional version of standardize that returns a standardized
      pattern as a new object;

    • a function incorporate_pauli_results that returns an equivalent
      pattern in which the results are incorporated into measurement
      and correction domains.
      The resulting pattern is suitable for flow analysis. In
      particular, if a pattern has a flow, it is preserved by
      perform_pauli_measurements after applying standardize and
      incorporate_pauli_results.

Fixed

  • #314, #322: The method Pattern.standardize() now correctly returns
    an equivalent pattern even in the presence of C commands, or raises
    an error if no standardized form exists.

  • #277: The result of repr() for Pattern, Circuit, Command,
    Instruction, Plane, Axis and Sign is now a valid Python
    expression and is more readable.

  • #235, #252, #273: The open graph representation is now compatible
    with pyzx 0.9, and conventions have been fixed to ensure that the
    semantics is preserved between circuits, ZX graphs, open graphs and
    patterns.

  • #302, #308, #312: Pattern, Circuit, PatternSimulator, and
    backends are now type-checked.

Changed

  • #277: The method Pattern.print_pattern is now deprecated.

  • #300: pr_calc parameter is removed in back-end initializers.
    The user can specify pr_calc in the constructor of
    RandomBranchSelector instead.

  • #300: rng is no longer stored in the backends; it is now passed as
    an optional argument to each simulation method.

  • #261: Moved all device interface functionalities to an external
    library and removed their implementation from this library.

  • #314, #322: The method Pattern.standardize() now places C commands
    after X and Z commands, making the resulting patterns suitable for
    flow analysis.
    The flow_from_pattern functions now fail if the input pattern is
    not strictly standardized (as checked by
    Pattern.is_standard(strict=True), which requires C commands to be
    last).
    Note: the method perform_pauli_measurements still places C
    commands before X and Z commands.

  • #312: Backend's State has been renamed to BackendState to avoid
    a name conflict with the State class defined in graphix.states,
    which represents the state of a single qubit.

  • #312: Backend[StateT_co] and DenseStateBackend[DenseStateT_co]
    are now parameterized by covariant type variables, allowing
    subclasses to narrow the type of the state field to match their
    specific state representation. Covariance is sound in this context
    because the classes are frozen, and it ensures that
    Backend[BackendState] is a supertype of all backend classes.