Skip to main content

Module matrix

Module matrix 

Source
Expand description

Small local-matrix fallback for commutation checks.

This module proves commutation by embedding both operations into the matrix space of their combined qubit support, multiplying them in both orders, and comparing the products up to a global phase. It is intended as a bounded fallback for concrete parameters after cheaper symbolic checks fail.

The fallback does not attempt symbolic evaluation. Any parameter that cannot be evaluated to a concrete f64, unsupported matrix construction, or support wider than the configured qubit bound produces None.

Functionsยง

matrix_commutation
Attempts matrix-based commutation on the union support of two operations.