Documentation
¶
Overview ¶
Package mathutil provides internal math helpers shared across goqu packages.
NormalizeAngle wraps an angle to (−π, π]. NearZeroMod2Pi tests whether an angle is effectively zero modulo 2π. StripParams and StripParamsAndDagger extract base gate names for decomposition lookups.
Package mathutil provides shared math helpers for internal use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NearZeroMod2Pi ¶
NearZeroMod2Pi reports whether angle is approximately 0 mod 2pi.
func NormalizeAngle ¶
NormalizeAngle wraps angle to (-pi, pi].
func StripParams ¶
StripParams strips parenthetical parameters from a gate name: "RZ(1.57)" -> "RZ", "H" -> "H".
func StripParamsAndDagger ¶
StripParamsAndDagger strips both parenthetical parameters and a trailing dagger suffix ("†") from a gate name: "S†" -> "S", "RZ(1.57)" -> "RZ".
Types ¶
This section is empty.