QuantumComputinglib learn · inspect · formalize
Checked on this commit 2,822 public declarations commit 07559c3d051f Build record

Block encoding · symbolic exact rational family

BE Case 2: cubic diagonal family, hinted route

Use the supplied idea 'first represent the diagonal input x_j, then target x_j^3' without treating that prose hint as a proof.

Lean certifiedA direct hint becomes a short formal route with separate exact Lean roots for the input and output blocks.

Read this before the proof dashboard

Learn the difference between a useful mathematical hint and a proof of the resulting quantum circuit.

A human hint says to first encode x_j=j/2^n and then think of the cubic target as x_j^3. That idea is valuable for choosing a route, but it does not by itself establish unitarity or a clean block.

This mirrors how research actually proceeds: algebra suggests a decomposition, while each quantum-access object still needs its own exact certificate.

Read the circuit

What the wires and stages are doing

1
Input block

Construct an exact block encoding of O0=diag(x_j).

2
Algebraic observation

On the target diagonal, D_n=O0^3.

3
Certified endpoint

The current library separately certifies an exact cubic Householder block rather than pretending the prose hint is a primitive QSVT circuit.

4
Boundary

No strict resource comparison is claimed because the two constructions use different branch widths and no betterThan theorem connects them.

The detailed circuit diagrams generated from the case record appear below this tutorial.

Statement → proof → optional Lean

The mathematical claims, in the order a human would prove them

Route theorem

The linear input and cubic output blocks are both exact

\[O_0=\sum_jx_j|j\rangle\langle j|,\quad D_n=O_0^3=\sum_jx_j^3|j\rangle\langle j|\]

Lean certifies the linear diagonal block and the cubic diagonal block as separate exact constructions; the identity D_n=O0^3 explains the hint but does not replace those certificates.

Proof story

  1. Formalize the hintTurn the prose suggestion into the two precise operator targets O0 and Dn.
  2. Certify O0Construct a rational Householder clean block with first coordinate x_j.
  3. Identify the desired polynomialThe target diagonal entry is exactly x_j^3.
  4. Certify DnUse the independent exact cubic Householder family theorem.
  5. Keep QSVT honestDo not label a polynomial identity as a synthesized QSVT phase sequence unless that separate route is proved.
Show the Lean proof checkpoints

The mathematical explanation above is the reading layer. These compiled declarations are the proof authority.

Mathematical target

The equation being studied

\[O_0=\sum_{j=0}^{2^n-1}x_j|j\rangle\!\langle j|,\quad x_j=\frac{j}{2^n},\qquad D_n=O_0^3=\sum_jx_j^3|j\rangle\!\langle j|.\]

Lean closes two named endpoints: an exact linear-diagonal Householder input block and an exact cubic-diagonal Householder output block. The algebraic hint chooses a route; each unitary and clean block is still proved independently.

O_0
the input diagonal operator suggested by the hint
D_n
the desired cubic diagonal operator
x_j
the exact rational grid point j/2^n

Circuit anatomy

How the candidate acts

These blocks show logical stages and register responsibilities. They do not pretend an unresolved logical oracle is already a primitive hardware gate.

Register ordern system qubits | clean Householder branch register
01

Input block

exactly encode diag(x_j)

BE(O_0)
02

Polynomial route

identify the desired diagonal entries x_j^3

z -> z^3
03

Output block

exact rational Householder completion

BE(D_n)

Auditable evolution

Candidate and proof progression

The stages show route closure. They are not claimed as a strict resource improvement because no same-tier better-than theorem is attached to this route.

iteration0

Hint parsed

Route selected

The prose suggestion is converted into two formal operator contracts.

Hint parsedket jO_0: x_jp(z)=z^3x_j^3
Grouped-register circuit. Open the source or workbench to adapt notation.
Lean rootQuantumBlockEncoding.CubicDiagonalOracle.linearDiagonalHouseholderInputBEContract_complete Edit and preview this stage →
Copy this stage as quantikz
\begin{quantikz}[column sep=.45cm]
\lstick{$\ket j$} & \gate{O_0:\,x_j} & \gate{p(z)=z^3} & \rstick{$x_j^3$} \qw
\end{quantikz}
not ranked at this tier
iteration1

Linear input block

Lean certified family

The input diagonal block has exact unitarity, projection, alpha, and resource fields.

Linear input blockket0H(v_j^(1))x_jket0+|perp_j>ket j
Grouped-register circuit. Open the source or workbench to adapt notation.
Lean rootQuantumBlockEncoding.CubicDiagonalOracle.linearDiagonalHouseholderInputBEContract_complete Edit and preview this stage →
Copy this stage as quantikz
\begin{quantikz}[row sep=.4cm, column sep=.55cm]
\lstick{$\ket0$} & \gate{H(v_j^{(1)})} & \rstick{$x_j\ket0+\ket{\perp_j}$} \qw \\
\lstick{$\ket j$}& \ctrl{-1}            & \qw
\end{quantikz}
1gates1depth1aux1oracles
iteration2

Cubic output block

Lean certified family

The desired cubic family is closed independently; the differing branch widths are not ranked here.

Cubic output block|0^3>H(v_j^(3))x_j^3ket0+|perp_j>ket j
Grouped-register circuit. Open the source or workbench to adapt notation.
Lean rootQuantumBlockEncoding.CubicDiagonalOracle.cubicDiagonalHouseholderExactBEContract_complete Edit and preview this stage →
Copy this stage as quantikz
\begin{quantikz}[row sep=.4cm, column sep=.55cm]
\lstick{$\ket{0^3}$} & \gate{H(v_j^{(3)})} & \rstick{$x_j^3\ket0+\ket{\perp_j}$} \qw \\
\lstick{$\ket j$}    & \ctrl{-1}            & \qw
\end{quantikz}
1gates1depth3aux1oracles

Reader workbench

Edit, preview, then copy

Change symbols, language, proof steps, or the grouped-register circuit locally in your browser. The preview is explanatory; the linked Lean declaration remains the certificate.

Mathematical construction

Proof steps

One step per line. Natural language and inline mathematics are both accepted.

    Quantum circuit

    Complete packet

    Copy the reviewed construction and proof

    The packet below is generated from the reviewed case record. The exact primitive authority is the linked Lean source and executable artifact.

    Construction and circuit LaTeX
    % Requires: \usepackage{quantikz}
    \paragraph{Construction.}
    \[
    O_0=\sum_{j=0}^{2^n-1}x_j|j\rangle\!\langle j|,\quad x_j=\frac{j}{2^n},\qquad D_n=O_0^3=\sum_jx_j^3|j\rangle\!\langle j|.
    \]
    
    % Hint parsed
    \begin{quantikz}[column sep=.45cm]
    \lstick{$\ket j$} & \gate{O_0:\,x_j} & \gate{p(z)=z^3} & \rstick{$x_j^3$} \qw
    \end{quantikz}
    
    % Linear input block
    \begin{quantikz}[row sep=.4cm, column sep=.55cm]
    \lstick{$\ket0$} & \gate{H(v_j^{(1)})} & \rstick{$x_j\ket0+\ket{\perp_j}$} \qw \\
    \lstick{$\ket j$}& \ctrl{-1}            & \qw
    \end{quantikz}
    
    % Cubic output block
    \begin{quantikz}[row sep=.4cm, column sep=.55cm]
    \lstick{$\ket{0^3}$} & \gate{H(v_j^{(3)})} & \rstick{$x_j^3\ket0+\ket{\perp_j}$} \qw \\
    \lstick{$\ket j$}    & \ctrl{-1}            & \qw
    \end{quantikz}
    English proof LaTeX
    \paragraph{Proof.}
    Lean closes two named endpoints: an exact linear-diagonal Householder input block and an exact cubic-diagonal Householder output block. The algebraic hint chooses a route; each unitary and clean block is still proved independently.
    \begin{enumerate}
      \item The prose suggestion is converted into two formal operator contracts.
      \item The input diagonal block has exact unitarity, projection, alpha, and resource fields.
      \item The desired cubic family is closed independently; the differing branch widths are not ranked here.
    \end{enumerate}
    Each advertised certificate is the named Lean declaration linked on this page.
    Lean declaration retrieval block
    import QuantumBlockEncoding
    
    #check QuantumBlockEncoding.CubicDiagonalOracle.linearDiagonalHouseholderInputBEContract_complete
    #check QuantumBlockEncoding.CubicDiagonalOracle.cubicDiagonalHouseholderExactBEContract_complete
    Show the complete Lean certificate list

    Open this when you want to inspect every declaration linked to the case.

    Proof authority

    Named Lean certificates

    These declarations, compiled by the current Lean gate, support the mathematical and resource claims above.

    Optional executable checks and outputs

    Executable verification and exports

    Checking and artifact selection are independent. A user may screen with Qiskit, OpenQASM round-trip, both, or neither, then request a different set of output files.

    Backend / artifactRoleStatusEvidence
    Internal canonical evaluatorReference semantics for primitive canonical IRopenmetrics manifest
    Qiskit OperatorGate-by-gate numerical screeningartifact availabletools/export_hard_cubic_householder.py
    OpenQASM 3 round-tripStrict serialization, import, and semantic replaynot recordedQASM and report when generated
    Lean certificateExact proof authority at the page's stated semantic tierpassed2 named root(s)

    Exports finite instances of both exact symbolic roots. Numerical comparisons do not certify either family.

    Current runnable artifact
    tools/export_hard_cubic_householder.py
    Command
    python3 tools/export_hard_cubic_householder.py --task QBE-HARD-CUBIC-DIAGONAL-HIER-HINTED-001
    Trust boundary. Fast executable checks may reject, rank, or queue a route for formalization. Floating-point tolerances do not replace the exact Lean roots above; an external exact certificate contributes only after a Lean checker verifies it.
    Source
    ASPBE BE Case 2 hinted route
    Contributor
    ASPBE authors
    Current boundary
    The current theorem uses exact Householder completion; it does not yet certify a QSVT primitive implementation.