Skip to content

Conversation

@ddri
Copy link
Contributor

@ddri ddri commented Sep 13, 2025

Prevents infinite hangs when quantum effects take too long to compute.

Problem

Large radius values can cause quantum simulations to run indefinitely, freezing the application and requiring force-quit with potential work loss.

Solution

  • Adds configurable 30-second timeout to run_estimator function
  • Provides helpful error message guiding users to reduce radius or simplify effects
  • Uses signal-based timeout with proper cleanup in finally block
  • Maintains backward compatibility with optional timeout parameter

Benefits

  • Prevents application freezes from long-running quantum simulations
  • Improves user experience with clear error guidance
  • Protects user work from being lost due to force-quit scenarios
  • Covers all 6 quantum effects since they all use run_estimator

Testing

  • Function loads without syntax errors
  • Timeout is configurable with 30 second default
  • Error message includes actionable guidance for users

Prevents infinite hangs when quantum effects take too long to compute.
Adds configurable 30-second timeout to run_estimator() with helpful
error message guiding users to reduce radius or simplify effects.

Fixes issue where large radius values could freeze the application
requiring force-quit and potential work loss.
artreadcode pushed a commit that referenced this pull request Dec 1, 2025
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.

1 participant