NLA-lib Explorer

NLAlib.SmallEig.polar_writes_sample

Library · theorem

A polar sample stores the sample of the window: on an exact polar disk sampler on the stream sU, from a radius word R at rd and room for two words at z, the call writes only those two words, stores the polar sample NLAlib.polarDisk of the window at the current position and advances the position by two. The rule for one call of the operation.

NLAlib.SmallEig.polar_writes_sample {O Q : Type} [Ops.Has ShiftedQR.DiskSampleOp O]
  {I : Ops.Interp O Q ℝ} {sU : ℕ} (hDisk : ShiftedQR.IsPolarDiskSampler sU I) {τ : Ops.Tape ℝ}
  {μ : Ops.Mem ℝ} {ρ : Ops.Env} {ins outs : List Ops.Operand} {rd z : ℕ × ℕ} {R : ℝ}
  (ha : Ops.Operand.evalList ρ ins = some [rd]) (hb : Ops.Operand.evalList ρ outs = some [z])
  (hrd : μ.store.get rd.1 rd.2 = some R) (hl : μ.Live [rd, z]) (hz : z.2 + 2 ≤ μ.store.len z.1) :
  Ops.Writes Ops.Mode.total I τ
    (Ops.Stmt.call (Ops.Has.inj ShiftedQR.DiskSampleOp.polar) [] ins outs) ρ
    (Ops.Store.inBlock z.1 z.2 2)
    (fun μ' ↦
      μ'.pos = μ.pos + 2 ∧
        μ'.store.readBlock z.1 z.2 2 =
          some
            [(polarDisk 0 R (τ.windowFn sU μ.pos 2)).re,
              (polarDisk 0 R (τ.windowFn sU μ.pos 2)).im])
    μ

Full source on GitHub

Import NLAlib.Eigensolvers.SmallEig.OneEigParts.