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))[source]¶
Bases:
objectQST 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.
- oracq.algorithms.qode.cbmd.cbmd_qode(model, time, *, plan=None, hamiltonian_function=<function taylor_hamiltonian>)[source]¶
Assemble the quantum simulation program for u’=-Au via contour decomposition.
- Parameters:
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.
- Returns:
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.
- Return type:
- Raises:
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)[source]¶
Generic f(A) assembly point: the Hermitian function protocol stays open and is not silently swapped for matrix inversion.
- Parameters:
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.
- Returns:
The residue-weighted f(A) block encoding, with correctness marked pending.
- Return type: