toqito icon indicating copy to clipboard operation
toqito copied to clipboard

Feature: ``is_separable`` Implement Global Strength/Effort Paramete

Open poig opened this issue 7 months ago • 1 comments

Is your feature request related to a problem? Please describe. User Story: As a toqito user, I want to control the computational effort of is_separable because sometimes I need a quick check, while other times I need the most thorough analysis possible, even if it takes longer.

Problem: The toqito.state_props.is_separable function has a level parameter that primarily controls the symmetric extension hierarchy depth. However, many other separability/entanglement checks have varying computational costs. toqito currently lacks a global mechanism for users to balance speed versus thoroughness across all checks.

Describe the solution you'd like

  1. Introduce a new integer parameter, strength: int = 0 (or a similar name like effort_level), to the is_separable function signature.

  2. Illustrative Behavior for strength values (Note: Specific criteria per level are subject to final design and performance profiling):

    • strength = 0 (Default): Performs standard, relatively fast checks (e.g., pure state analysis, separable ball, PPT criterion, low-dimensional PPT sufficiency, basic Horodecki rank conditions, basic realignment criteria, common 2xN checks, and a baseline symmetric extension like level=2).
    • strength = 1: Includes more computationally intensive checks such as Filter CMC (see Issue #XYZ), more exhaustive 2xN conditions, iterative product state subtraction (see Issue #ABC), and potentially deeper default symmetric extension levels.
    • strength = -1 (or a high positive value like strength = 2 or 3): Attempts to be as exhaustive as possible with all implemented criteria, running all available tests.
  3. Modify the control flow within is_separable to conditionally execute certain blocks of tests based on the strength parameter.

  4. Interaction with level parameter: The interaction between the existing level (for symmetric extensions) and the new strength parameter needs a clear design decision. Options include:

    • A) level is an explicit override: If set by the user, it's respected. If not, its default is influenced by strength.
    • B) strength suggests a default or cap for level. This decision should be finalized during implementation.
  5. Update the is_separable docstring extensively to explain the strength parameter, its different levels (with the caveat about final criteria), and its interaction with other parameters like level.

Describe alternatives you've considered Multiple boolean flags: Becomes unwieldy. Relying solely on level: Too specific and lacks global control.

Additional context This feature is inspired by QETLAB's STR parameter. It allows users to tailor the function's behavior to their specific needs regarding computational resources and desired certainty. The prioritization of this feature relative to the implementation of the computationally intensive checks it would gate should be considered.

poig avatar Jun 05 '25 12:06 poig

Nice capture, @poig ! I agree and thank you for writing this up!

vprusso avatar Jun 05 '25 15:06 vprusso