Documentation
¶
Overview ¶
Package param provides symbolic parameters and expressions for parameterized quantum circuits.
A Parameter represents a named symbolic value; related parameters can be grouped in a Vector. Parameters are combined into an Expr tree using Literal, Add, Sub, Mul, Div, and Neg.
Symbolic gate constructors (SymRX, SymRY, SymRZ, SymPhase, SymU3, SymCP) accept Expr arguments instead of float64 values. Before simulation, bind all free parameters to concrete values with [ir.Bind].
Package param provides symbolic parameters and expressions for variational circuits.
Index ¶
- func SymCP(phi Expr) gate.Gate
- func SymFSim(theta, phi Expr) gate.Gate
- func SymGlobalPhase(phi Expr) gate.Gate
- func SymPSwap(phi Expr) gate.Gate
- func SymPhase(phi Expr) gate.Gate
- func SymRX(theta Expr) gate.Gate
- func SymRXX(theta Expr) gate.Gate
- func SymRY(theta Expr) gate.Gate
- func SymRYY(theta Expr) gate.Gate
- func SymRZ(theta Expr) gate.Gate
- func SymRZZ(theta Expr) gate.Gate
- func SymRot(phi, theta, omega Expr) gate.Gate
- func SymU1(lambda Expr) gate.Gate
- func SymU2(phi, lambda Expr) gate.Gate
- func SymU3(theta, phi, lambda Expr) gate.Gate
- type Expr
- type Parameter
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SymGlobalPhase ¶ added in v1.2.0
SymGlobalPhase creates a symbolic GlobalPhase gate.
Types ¶
type Expr ¶
type Expr interface {
// Eval evaluates the expression with the given bindings.
// Returns an error if any required parameter is unbound.
Eval(bindings map[string]float64) (float64, error)
// Parameters returns all free parameters in the expression.
Parameters() []*Parameter
// String returns a human-readable representation.
String() string
// IsNumeric returns true if this expression has no free parameters.
IsNumeric() bool
}
Expr represents a symbolic expression over parameters.
type Parameter ¶
type Parameter struct {
// contains filtered or unexported fields
}
Parameter is a named symbolic parameter.