Skip to content

Add ACircuit.compute_fock_matrix - #767

Open
anthonyrtw wants to merge 1 commit into
Quandela:developfrom
anthonyrtw:fock-unitary
Open

Add ACircuit.compute_fock_matrix#767
anthonyrtw wants to merge 1 commit into
Quandela:developfrom
anthonyrtw:fock-unitary

Conversation

@anthonyrtw

@anthonyrtw anthonyrtw commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds compute_fock_matrix to linear optical circuits, allowing users to compute transition-amplitude matrices over a supplied Fock-state basis.

Changes

  • Computes Fock-space transition amplitudes using permanents of repeated-row/repeated-column submatrices.
  • Supports exact permanent methods: ryser and glynn.
  • Supports approximate Gurvits permanent estimation via n_iter.
  • Handles mixed photon-number bases by returning zero amplitudes between sectors.
  • Rejects polarized circuits for now.

To use

from exqalibur import FSArray
from perceval import *

m = 5
n  = 3
circuit = Unitary.random(5)
basis = FSArray(m, n)

exact_unitary = circuit.compute_fock_matrix(basis, perm_method="ryser")
est_unitary = circuit.compute_fock_matrix(basis, perm_method="gurvits", n_iter=10_000)

Tests

  • Added coverage comparing compute_fock_matrix amplitudes against SLOS simulation output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant