Skip to content

Conversation

@ryankert01
Copy link
Contributor

@ryankert01 ryankert01 commented Jan 5, 2026

Purpose of PR

The validation logic in QuMat.execute_circuit only raised an error when all parameters were unbound. If a user bound only some parameters in a multi-parameter circuit, validation passed and execution failed with backend-specific errors.

qumat.apply_rx_gate(0, "theta0")
qumat.apply_ry_gate(1, "phi1")

# Before: KeyError/NameError from backend
# After: ValueError("Circuit contains unbound parameters: ['phi1']...")
qumat.execute_circuit(parameter_values={"theta0": math.pi})

Related Issues or PRs

Closes #780

Changes Made

  • Bug fix
  • New feature
  • Refactoring
  • Documentation
  • Test
  • CI/CD pipeline
  • Other

Breaking Changes

  • Yes
  • No

Checklist

  • Added or updated unit tests for all changes
  • Added or updated documentation for all changes
  • Successfully built and ran all unit tests or manual tests locally
  • PR title follows "MAHOUT-XXX: Brief Description" format (if related to an issue)
  • Code follows ASF guidelines

@guan404ming guan404ming merged commit ac5e580 into apache:main Jan 5, 2026
3 checks passed
@ryankert01 ryankert01 deleted the fix-circuit-validation branch January 5, 2026 05:11
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.

[Bug] Partial parameter binding bypasses validation in execute_circuit

2 participants