mathutil

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 1 Imported by: 0

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

func NearZeroMod2Pi(angle float64) bool

NearZeroMod2Pi reports whether angle is approximately 0 mod 2pi.

func NormalizeAngle

func NormalizeAngle(angle float64) float64

NormalizeAngle wraps angle to (-pi, pi].

func StripParams

func StripParams(name string) string

StripParams strips parenthetical parameters from a gate name: "RZ(1.57)" -> "RZ", "H" -> "H".

func StripParamsAndDagger

func StripParamsAndDagger(name string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL