CBMD

oracq.algorithms.qode.cbmd

Contour-decomposition-based assembly of matrix functions and evolution, explicitly recording the finite series and omitted terms.

class oracq.algorithms.qode.cbmd.ContourPlan(a=1.0, cutoff=2, poles=(2j, -1 + 1j, 1j, 1 + 1j))[源代码]

基类:object

QST Eq.12 main series; auxiliary poles and the finite truncation remainder are explicitly retained in the report.

a = 1.0
cutoff = 2
poles = (2j, (-1+1j), 1j, (1+1j))
property nodes

Real nodes of the main series; entry k is k/a with k in -cutoff..cutoff, 2*cutoff+1 in total.

property weights

Complex weights of the main series nodes, in one-to-one correspondence with nodes.

Computed by the residue closed form of QST Eq.12; the denominator contains the (q+i) factor and all auxiliary poles.

property auxiliary_coefficients

Complex coefficients of the auxiliary poles, in one-to-one correspondence with poles.

The corresponding non-Hermitian evolution branches are not generated currently and are only declared in the omitted list of metadata.

metadata()[源代码]

Export the plan parameters and the omitted-terms declaration as JSON text.

返回:

Contains a, cutoff, nodes, poles, weights, auxiliary coefficients, the omitted terms, the assumption preconditions, and the source reference.

返回类型:

str

oracq.algorithms.qode.cbmd.cbmd_qode(model, time, *, plan=None, hamiltonian_function=<function taylor_hamiltonian>)[源代码]

Assemble the quantum simulation program for u'=-Au via contour decomposition.

参数:
  • model -- LinearODE input model; parts.hermitian is L, parts.h is H, and initial is the initial state preparation.

  • time -- Non-negative evolution time.

  • plan -- ContourPlan contour plan; the default plan is used when omitted.

  • hamiltonian_function -- Replaceable protocol taking (K, time) and returning a BlockEncoding.

返回:

Per-node K_k=H+q_k*L branches combined via LCU and applied to the initial state; the success subspace is all-zero signal.

返回类型:

StateOracle

抛出:

ValidationError -- model or plan has the wrong type, time is invalid, or the input capability contract is not satisfied.

Auxiliary-pole branches and the infinite series tail are not generated and are only declared explicitly in the contour_plan metadata.

oracq.algorithms.qode.cbmd.cbmd_function(a, nodes, residue_weights, hermitian_function)[源代码]

Generic f(A) assembly point: the Hermitian function protocol stays open and is not silently swapped for matrix inversion.

参数:
  • a -- Block encoding of the target operator A.

  • nodes -- Residue pole locations, entering the H + q*L combination point by point.

  • residue_weights -- Complex residue weights in one-to-one correspondence with the poles; the sign convention is the caller's responsibility.

  • hermitian_function -- Hermitian function protocol implementation; the input is the block encoding after the pole combination, and it must return a BlockEncoding.

返回:

The residue-weighted f(A) block encoding, with correctness marked pending.

返回类型:

BlockEncoding