qrisp.cks.cks_params#
- cks_params(eps: float, kappa: float, max_beta: int = None) Tuple[int, int][source]#
Computes the complexity parameter \(\beta\) and the truncation order \(j_0\) for the truncated Chebyshev approximation of \(1/x\), as described in the Childs–Kothari–Somma paper.
Given the condition number \(\kappa\) and the target precision \(\epsilon\), the parameters are computed as:
\[\beta = \kappa^2 \log\!\left(\frac{\kappa}{\epsilon}\right), \quad j_0 = \sqrt{\beta \log\!\left(\frac{4\beta}{\epsilon}\right)}.\]If
max_betais provided, \(\beta\) is capped to \(\min(\beta, \beta_{\max})\). The returned values are cast to integers via the floor operation.- Parameters:
- epsfloat
Target precision \(\epsilon\).
- kappafloat
An upper bound for the condition number \(\kappa\) of \(A\). This value defines the “gap” around zero where the function \(1/x\) is not approximated.
- max_betafloat, optional
Optional upper bound on the complexity parameter \(\beta\).
- Returns:
- j0int
Truncation order of the Chebyshev expansion \(j_0 = \lfloor\sqrt{\beta \log(4\beta/\epsilon)}\rfloor\).
- betaint
Complexity parameter \(\beta = \lfloor\kappa^2 \log(\kappa/\epsilon)\rfloor\).