FQE vs OpenFermion vs Cirq: Diagonal Coulomb Operators

View on QuantumAI Run in Google Colab View source on GitHub Download notebook

Special routines are available for evolving under a diagonal Coulomb operator. This notebook describes how to use these built in routines and how they work.

try:
    import fqe
except ImportError:
    !pip install fqe --quiet
from itertools import product
import fqe
from fqe.hamiltonians.diagonal_coulomb import DiagonalCoulomb

import numpy as np

import openfermion as of

from scipy.linalg import expm
#Utility function
def uncompress_tei(tei_mat, notation='chemistry'):
    """
    uncompress chemist notation integrals

    tei_tensor[i, k, j, l] = tei_mat[(i, j), (k, l)]
    [1, 1, 2, 2] = [1, 1, 2, 2] = [1, 1, 2, 2]  = [1, 1, 2, 2]
    [i, j, k, l] = [k, l, i, j] = [j, i, l, k]* = [l, k, j, i]*

    For real we also have swap of i <> j and k <> l
    [j, i, k, l] = [l, k, i, j] = [i, j, l, k] = [k, l, j, i]

    tei_mat[(i, j), (k, l)] = int dr1 int dr2 phi_i(dr1) phi_j(dr1) O(r12) phi_k(dr1) phi_l(dr1)

    Physics notation is the notation that is used in FQE.

    Args:
        tei_mat: compressed two electron integral matrix

    Returns:
        uncompressed 4-electron integral tensor. No antisymmetry.
    """
    if notation not in ['chemistry', 'physics']:
        return ValueError("notation can be [chemistry, physics]")

    norbs = int(0.5 * (np.sqrt(8 * tei_mat.shape[0] + 1) - 1))
    basis = {}
    cnt = 0
    for i, j in product(range(norbs), repeat=2):
        if i >= j:
            basis[(i, j)] = cnt
            cnt += 1

    tei_tensor = np.zeros((norbs, norbs, norbs, norbs))
    for i, j, k, l in product(range(norbs), repeat=4):
        if i >= j and k >= l:
            tei_tensor[i, j, k, l] = tei_mat[basis[(i, j)], basis[(k, l)]]
            tei_tensor[k, l, i, j] = tei_mat[basis[(i, j)], basis[(k, l)]]
            tei_tensor[j, i, l, k] = tei_mat[basis[(i, j)], basis[(k, l)]]
            tei_tensor[l, k, j, i] = tei_mat[basis[(i, j)], basis[(k, l)]]

            tei_tensor[j, i, k, l] = tei_mat[basis[(i, j)], basis[(k, l)]]
            tei_tensor[l, k, i, j] = tei_mat[basis[(i, j)], basis[(k, l)]]
            tei_tensor[i, j, l, k] = tei_mat[basis[(i, j)], basis[(k, l)]]
            tei_tensor[k, l, j, i] = tei_mat[basis[(i, j)], basis[(k, l)]]

    if notation == 'chemistry':
        return tei_tensor
    elif notation == 'physics':
        return np.asarray(tei_tensor.transpose(0, 2, 1, 3), order='C')

    return tei_tensor

The first example we will perform is diagonal Coulomb evolution on the Hartree-Fock state. The diagonal Coulomb operator is defined as

\begin{align} V = \sum{\alpha, \beta \in {\uparrow, \downarrow} }\sum{p,q} V{pq,pq}n{p,\alpha}n_{q,\beta} \end{align}

The number of free parpameters are \(\mathcal{O}(N^{2})\) where \(N\) is the rank of the spatial basis. The DiagonalCoulomb Hamiltonian takes either a generic 4-index tensor or the \(N \times N\) matrix defining \(V\). If the 4-index tensor is given the \(N \times N\) matrix is constructed along with the diagonal correction. If the goal is to just evolve under \(V\) it is recommended the user input the \(N \times N\) matrix directly.

All the terms in \(V\) commute and thus we can evolve under \(V\) exactly by counting the accumulated phase on each bitstring.

To start out let's define a Hartree-Fock wavefunction for 4-orbitals and 2-electrons \(S_{z} =0\).

norbs = 4
tedim = norbs * (norbs + 1) // 2
if (norbs // 2) % 2 == 0:
    n_elec = norbs // 2
else:
    n_elec = (norbs // 2) + 1
sz = 0
fqe_wfn = fqe.Wavefunction([[n_elec, sz, norbs]])
fci_data = fqe_wfn.sector((n_elec, sz))
fci_graph = fci_data.get_fcigraph()
hf_wf = np.zeros((fci_data.lena(), fci_data.lenb()), dtype=np.complex128)
hf_wf[0, 0] = 1  # right most bit is zero orbital.
fqe_wfn.set_wfn(strategy='from_data',
                raw_data={(n_elec, sz): hf_wf})
fqe_wfn.print_wfn()
Sector N = 2 : S_z = 0
a'0001'b'0001' (1+0j)

Now we can define a random 2-electron operator \(V\). To define \(V\) we need a \(4 \times 4\) matrix. We will generate this matrix by making a full random two-electron integral matrix and then just take the diagonal elements

tei_compressed = np.random.randn(tedim**2).reshape((tedim, tedim))
tei_compressed = 0.5 * (tei_compressed + tei_compressed.T)
tei_tensor = uncompress_tei(tei_compressed, notation='physics')

diagonal_coulomb = of.FermionOperator()
diagonal_coulomb_mat = np.zeros((norbs, norbs))
for i, j in product(range(norbs), repeat=2):
    diagonal_coulomb_mat[i, j] = tei_tensor[i, j, i, j]
    for sigma, tau in product(range(2), repeat=2):
        diagonal_coulomb += of.FermionOperator(
            ((2 * i + sigma, 1), (2 * i + sigma, 0), (2 * j + tau, 1),
             (2 * j + tau, 0)), coefficient=diagonal_coulomb_mat[i, j])

dc_ham = DiagonalCoulomb(diagonal_coulomb_mat)

Evolution under \(V\) can be computed by looking at each bitstring, seeing if \(n_{p\alpha}n_{q\beta}\) is non-zero and then phasing that string by \(V_{pq}\). For the Hartree-Fock state we can easily calculate this phase accumulation. The alpha and beta bitstrings are "0001" and "0001".

alpha_occs = [list(range(fci_graph.nalpha()))]
beta_occs = [list(range(fci_graph.nbeta()))]
occs = alpha_occs[0] + beta_occs[0]
diag_ele = 0.
for ind in occs:
    for jnd in occs:
        diag_ele += diagonal_coulomb_mat[ind, jnd]
evolved_phase = np.exp(-1j * diag_ele)
print(evolved_phase)

# evolve FQE wavefunction
evolved_hf_wfn = fqe_wfn.time_evolve(1, dc_ham)

# check they the accumulated phase is equivalent!
assert np.isclose(evolved_hf_wfn.get_coeff((n_elec, sz))[0, 0], evolved_phase)
(0.2572371712732047-0.9663483004152074j)

We can now try this out for more than 2 electrons. Let's reinitialize a wavefunction on 6-orbitals with 4-electrons \(S_{z} = 0\) to a random state.

norbs = 6
tedim = norbs * (norbs + 1) // 2
if (norbs // 2) % 2 == 0:
    n_elec = norbs // 2
else:
    n_elec = (norbs // 2) + 1
sz = 0
fqe_wfn = fqe.Wavefunction([[n_elec, sz, norbs]])
fqe_wfn.set_wfn(strategy='random')
initial_coeffs = fqe_wfn.get_coeff((n_elec, sz)).copy()
print("Random initial wavefunction")
fqe_wfn.print_wfn()
Random initial wavefunction
Sector N = 4 : S_z = 0
a'000011'b'000011' (0.042723881546645005+0.035060001019624726j)
a'000011'b'000101' (0.016392012619723263+0.00860796270001949j)
a'000011'b'001001' (-0.022914044755583157-0.033700233042421326j)
a'000011'b'010001' (0.016067005360414978+0.04165671690577607j)
a'000011'b'100001' (-0.05955575026590945-0.031886100390836905j)
a'000011'b'000110' (0.054759394510452385-0.01752728278601128j)
a'000011'b'001010' (-0.03497927804165091-0.004003840037308554j)
a'000011'b'010010' (-0.014188789656290907+0.08862622292993143j)
a'000011'b'100010' (0.015177114306910267+0.03768789627727432j)
a'000011'b'001100' (0.05859395272337468-0.04406289680205764j)
a'000011'b'010100' (0.004574295180592011-0.04126868619487522j)
a'000011'b'100100' (0.02255472405186681+0.05084650450240739j)
a'000011'b'011000' (-0.12631774691609146+0.023225682784524502j)
a'000011'b'101000' (0.10184045430700776-0.04628155725798927j)
a'000011'b'110000' (0.05118257458849547-0.004713562648991539j)
a'000101'b'000011' (-0.06315697437581626-0.00727575468138937j)
a'000101'b'000101' (-0.03221191738728006-0.021677103421264644j)
a'000101'b'001001' (0.0010131594703976067-0.03313382924538184j)
a'000101'b'010001' (0.012795417953876514-0.09093012819447258j)
a'000101'b'100001' (0.021891394619478526+0.007483382722168971j)
a'000101'b'000110' (-0.03909066056967735-0.002409616326738141j)
a'000101'b'001010' (-0.07827601033140423+0.00452748664871112j)
a'000101'b'010010' (-0.004161250403188087-0.024223673255358822j)
a'000101'b'100010' (0.02363820229080608+0.018319687224074867j)
a'000101'b'001100' (0.08026788262618664+0.04754928604104284j)
a'000101'b'010100' (-0.027831984989934794+0.02382805201923965j)
a'000101'b'100100' (-0.09271967744101768+0.03851608364663657j)
a'000101'b'011000' (-0.028687487941991347-0.06481581774614513j)
a'000101'b'101000' (-0.02059955966530714+0.11117361208021237j)
a'000101'b'110000' (0.019288590109831825-0.020366411169626848j)
a'001001'b'000011' (-0.021832257316463016+0.025451559085175678j)
a'001001'b'000101' (0.05815245584163632+0.04070483961091581j)
a'001001'b'001001' (0.003286247687425303-0.035103128665872695j)
a'001001'b'010001' (-0.0682937492707702+0.020797130649532758j)
a'001001'b'100001' (-0.04152969912836528+0.007002319536790471j)
a'001001'b'000110' (-0.009901987943147122+0.0018955535999612154j)
a'001001'b'001010' (-0.05821545217794205-0.013383025251892534j)
a'001001'b'010010' (-0.08431393095015115-0.01764662069104032j)
a'001001'b'100010' (-0.004476937191309459-0.06275945834170144j)
a'001001'b'001100' (-0.10485748247862542+0.0010610373296912174j)
a'001001'b'010100' (0.08882364221494714-0.07792894738545589j)
a'001001'b'100100' (-0.02905543574873318+0.012852097851361677j)
a'001001'b'011000' (0.01383249338315274-0.0183357480243795j)
a'001001'b'101000' (0.08848294484024634-0.010918226267039753j)
a'001001'b'110000' (-0.006413725256560698+0.015811345528433395j)
a'010001'b'000011' (0.09028075881818438-0.009453662191376866j)
a'010001'b'000101' (-0.02297621860197415-0.10675172283040875j)
a'010001'b'001001' (-0.012470093133436621-0.028779729354551063j)
a'010001'b'010001' (-0.024530063709882352+0.0738802124128298j)
a'010001'b'100001' (0.005096761185063938+0.010016628904708235j)
a'010001'b'000110' (0.08699249803775805-0.04382328153215209j)
a'010001'b'001010' (0.03217697196909221+0.019368467339697163j)
a'010001'b'010010' (0.033768653716575156+0.008237179551512196j)
a'010001'b'100010' (-0.05306276831691843-0.0064168958440130024j)
a'010001'b'001100' (-0.014980105249463058+0.052979862708321716j)
a'010001'b'010100' (0.050998395539795904+0.06310753487579383j)
a'010001'b'100100' (-0.03915255766553384+0.016588886044632097j)
a'010001'b'011000' (0.0642376775589674-0.03524143240145347j)
a'010001'b'101000' (-0.06672672269621338+0.008014012776803695j)
a'010001'b'110000' (0.02736059369778003-0.011338340256083958j)
a'100001'b'000011' (-0.026952897430493575+0.020183889311272765j)
a'100001'b'000101' (-0.05049232097131485+0.05559567148556094j)
a'100001'b'001001' (0.00010681708826260269+0.05695450800621829j)
a'100001'b'010001' (0.02261887463012195+0.008242711368000526j)
a'100001'b'100001' (0.07030530835433575+0.03210957455262564j)
a'100001'b'000110' (-0.0675769713929443-0.056735334418736946j)
a'100001'b'001010' (-0.009507728039842404+0.0022508451204929316j)
a'100001'b'010010' (0.02605054173353775-0.045846434117811655j)
a'100001'b'100010' (0.005708484363180037-0.004095689069373205j)
a'100001'b'001100' (0.1118373611104958-0.003732625270394508j)
a'100001'b'010100' (-0.03677519286024175-0.04171345060668449j)
a'100001'b'100100' (0.048458329993877176+0.03287837848884785j)
a'100001'b'011000' (0.03669478165388152+0.051934225523040764j)
a'100001'b'101000' (-0.027749771859492792-0.004086336348087359j)
a'100001'b'110000' (-0.011275035177393825+0.04427004101405875j)
a'000110'b'000011' (-0.0045138881184983775+0.030978732321155594j)
a'000110'b'000101' (-0.012043470946651895-0.04848804808964598j)
a'000110'b'001001' (0.0800797005875111-0.022487047271439683j)
a'000110'b'010001' (0.03470944591439949-0.04368951648939084j)
a'000110'b'100001' (0.010507144250125907-0.01094868480604112j)
a'000110'b'000110' (-0.0388354902819485-0.0006303815540489085j)
a'000110'b'001010' (0.0528738947328298+0.00048232099041763403j)
a'000110'b'010010' (-0.04378450159912941+0.02304150420988042j)
a'000110'b'100010' (-0.11071394179369011+0.0720171875646043j)
a'000110'b'001100' (-0.0659533526072951-0.09316561858267071j)
a'000110'b'010100' (-0.04042031237229581-9.59043720805609e-05j)
a'000110'b'100100' (-0.007781722158995985-0.05803586725793078j)
a'000110'b'011000' (0.05834087598747642+0.007761605836023239j)
a'000110'b'101000' (-0.008973528976065315+0.006340545857790258j)
a'000110'b'110000' (0.03303611779790324+0.0344328746253734j)
a'001010'b'000011' (-0.018713730629984902-0.012869193122292484j)
a'001010'b'000101' (-0.015625245493713226+0.0358395218300996j)
a'001010'b'001001' (0.06111128772347355-0.054051754954704746j)
a'001010'b'010001' (0.08783960417450516+0.0889258139365612j)
a'001010'b'100001' (-0.02357038824498739-0.01851619869556727j)
a'001010'b'000110' (0.012132356416249606-0.024924196837463754j)
a'001010'b'001010' (-0.04488701990196965-0.04859587281722907j)
a'001010'b'010010' (0.09205195879121279+0.050213589234428355j)
a'001010'b'100010' (-0.010137432694297316-0.08736895392247379j)
a'001010'b'001100' (0.04183032057786843+0.0211311400722825j)
a'001010'b'010100' (-0.039770519990744886+0.04171056817681883j)
a'001010'b'100100' (-0.07960972680027477+0.009419588285199159j)
a'001010'b'011000' (-0.02615425268774612-0.09120254921606392j)
a'001010'b'101000' (-0.04963007878753573-0.09850893369630337j)
a'001010'b'110000' (0.03700756078440281-0.0010554239022275017j)
a'010010'b'000011' (0.03461001434374587-0.04145498586293739j)
a'010010'b'000101' (0.040707036226218206+0.07398943772134478j)
a'010010'b'001001' (-0.003289808778398022+0.03005126737260755j)
a'010010'b'010001' (-0.11498822023649824-0.0011865180612529308j)
a'010010'b'100001' (0.08939838990713819+0.03014069839912149j)
a'010010'b'000110' (0.009029442547651275+0.04218861304635163j)
a'010010'b'001010' (0.09190850525827819+0.004394835918202389j)
a'010010'b'010010' (-0.0023174015957120363-0.03219017708954419j)
a'010010'b'100010' (-0.017268950431363766-0.0013634802468386142j)
a'010010'b'001100' (0.04675992016637583+0.10868362887050247j)
a'010010'b'010100' (0.04352363144753905+0.016742139565921764j)
a'010010'b'100100' (-0.028257369181845335-0.05986063612418385j)
a'010010'b'011000' (0.01370046139741873-0.07720982464532035j)
a'010010'b'101000' (0.06182947452125467-0.0037188064296141033j)
a'010010'b'110000' (0.009907541449045442-0.027013635192832848j)
a'100010'b'000011' (-0.019198257297158745+0.024272884679927473j)
a'100010'b'000101' (-0.007361362359992917+0.013066782468171292j)
a'100010'b'001001' (-0.04176758138708272+0.009359887303567661j)
a'100010'b'010001' (-0.0032564727913165408+0.03416023646724862j)
a'100010'b'100001' (0.026593229229824412+0.05249889711190915j)
a'100010'b'000110' (0.06616800503801447+0.0087803421183247j)
a'100010'b'001010' (-0.10726317356920502+0.017106862505861863j)
a'100010'b'010010' (0.026801365980158743-0.0027890870444431688j)
a'100010'b'100010' (0.005073675763207932-0.03264854451962996j)
a'100010'b'001100' (0.012393263801954456-0.07896249806967623j)
a'100010'b'010100' (-0.0037426093552881275+0.030035242128286902j)
a'100010'b'100100' (0.01925726286808798-0.06651136221932877j)
a'100010'b'011000' (0.03652541774583556+0.08492456266650585j)
a'100010'b'101000' (0.08860463349971558+0.038572283654641146j)
a'100010'b'110000' (0.07219655328966416-0.004132812316981934j)
a'001100'b'000011' (0.019320324193839847+0.029656396129288037j)
a'001100'b'000101' (0.046796268915109344+0.0011393787280659466j)
a'001100'b'001001' (0.031218056119311433+0.018038579882323682j)
a'001100'b'010001' (-0.03646910978789972+0.0014802875875221946j)
a'001100'b'100001' (0.05821910771898435-0.053630846395987j)
a'001100'b'000110' (-0.0028146284823811307+0.08392564014033799j)
a'001100'b'001010' (0.0787474276895606+0.05999312093931363j)
a'001100'b'010010' (-0.0491650738551867-0.003968365517478534j)
a'001100'b'100010' (-0.053679360504972566+0.0008601485309705827j)
a'001100'b'001100' (-0.002323288586813284+0.02188163347382015j)
a'001100'b'010100' (-0.03532390585620589+0.07086715314371425j)
a'001100'b'100100' (-0.007264700091631646-0.02471691247188435j)
a'001100'b'011000' (-0.08264700790321698+0.035918110701139976j)
a'001100'b'101000' (0.027830968597083408-0.0003180741555894716j)
a'001100'b'110000' (-0.012082947722950549+0.013181890194096268j)
a'010100'b'000011' (-0.013557860139998759-0.04765970091202607j)
a'010100'b'000101' (-0.04914827674342305-0.02554518296383938j)
a'010100'b'001001' (0.03001673556307277+0.06473270791188221j)
a'010100'b'010001' (-0.14204900022809452+0.056226866569942476j)
a'010100'b'100001' (0.010761657667771362+0.03599403666321974j)
a'010100'b'000110' (0.024182071449909165+0.024164157246443666j)
a'010100'b'001010' (-0.022490036062481452+0.038590767268325776j)
a'010100'b'010010' (0.000801128260732292+0.022655659384869686j)
a'010100'b'100010' (0.1018225756343848+0.06836802112513064j)
a'010100'b'001100' (-0.012282064759237033-0.028338572994514203j)
a'010100'b'010100' (0.005415222685303116+0.04984635889668857j)
a'010100'b'100100' (0.04499349582944031-0.07540874328653034j)
a'010100'b'011000' (-0.04323439866444855-0.05027036639769722j)
a'010100'b'101000' (-0.017857739519747316-0.023300671502053553j)
a'010100'b'110000' (-0.017239159986739076+0.06163903981626946j)
a'100100'b'000011' (0.00014901940579537483-0.011916980395568964j)
a'100100'b'000101' (0.02736097986948683-0.021246695012507897j)
a'100100'b'001001' (-0.03962134561525928-0.047534876622108924j)
a'100100'b'010001' (0.0433784670259904+0.035225005486386136j)
a'100100'b'100001' (-0.009235812444345064-0.06398128561592878j)
a'100100'b'000110' (0.027621018935701215+0.04446595129064624j)
a'100100'b'001010' (-0.08619635026385143+0.031968620509527174j)
a'100100'b'010010' (0.06640646364822722+0.040197795572344215j)
a'100100'b'100010' (0.022274627024490228+0.01512898510028142j)
a'100100'b'001100' (0.020419743229938322-0.05032538021550382j)
a'100100'b'010100' (-0.04527101871272999-0.03732087316797873j)
a'100100'b'100100' (-0.054463343385965125+0.03895049685490276j)
a'100100'b'011000' (-0.08566384183787801+0.06124107810397537j)
a'100100'b'101000' (0.019661583760835377-0.015232993504259721j)
a'100100'b'110000' (-0.012489521584251626+0.0021701224504743345j)
a'011000'b'000011' (0.010802703950269511+0.01584896930701025j)
a'011000'b'000101' (0.02545944335163199-0.017976367009324788j)
a'011000'b'001001' (0.050213362926779206+0.051160489096624746j)
a'011000'b'010001' (-0.05947043502391695+0.1566276131851006j)
a'011000'b'100001' (0.0065279419415157115-0.012215417365916482j)
a'011000'b'000110' (-0.047518855337113974-0.048107078819412744j)
a'011000'b'001010' (-0.02674419719950949+0.05915566896869868j)
a'011000'b'010010' (-0.02130234327282951+0.10149933663610619j)
a'011000'b'100010' (0.008623144566054529-0.04786851343123561j)
a'011000'b'001100' (0.00896930611568494-0.020392694766196994j)
a'011000'b'010100' (0.09001211483194035+0.05508857614966609j)
a'011000'b'100100' (0.05601740202663447-0.011241287117931539j)
a'011000'b'011000' (0.02378907731263059-0.0038712541197110616j)
a'011000'b'101000' (-0.04157865891307579+0.08694732503291643j)
a'011000'b'110000' (0.003202127366679507-0.031111068270150474j)
a'101000'b'000011' (0.03741077833232749-0.024590526567576727j)
a'101000'b'000101' (-0.058490852667400776+0.0013511248775890407j)
a'101000'b'001001' (-0.03838460487952141-0.03729586763103183j)
a'101000'b'010001' (-0.04508001775870073+0.005366146595414942j)
a'101000'b'100001' (-0.012178316502042917-0.02333745479650453j)
a'101000'b'000110' (-0.05272918597664742+0.07625262388472592j)
a'101000'b'001010' (-0.022137402330015685-0.03973389452876425j)
a'101000'b'010010' (-0.001255633074297381-0.023348481178081693j)
a'101000'b'100010' (-0.00735718612739052-0.00386511015476631j)
a'101000'b'001100' (0.030787525095100587+0.014418544055494208j)
a'101000'b'010100' (-0.09969606985774664+0.010616313486740967j)
a'101000'b'100100' (0.00073703467098185-0.02746707956685819j)
a'101000'b'011000' (0.012033643020420917+0.006909804565611412j)
a'101000'b'101000' (0.019449106773840236+0.06727108955565866j)
a'101000'b'110000' (-0.11887973045871023-0.024832372295174487j)
a'110000'b'000011' (0.015251274604571787-0.01888405074389288j)
a'110000'b'000101' (-0.025154645300289453+0.04579768627191767j)
a'110000'b'001001' (0.03100092834886622-0.04382443564983984j)
a'110000'b'010001' (-0.14622480215974756-0.035581845923632296j)
a'110000'b'100001' (-0.03461285763951099+0.02573501627749652j)
a'110000'b'000110' (0.010877264938502152-0.07942005966288256j)
a'110000'b'001010' (0.01595365191562556-0.013226382182825177j)
a'110000'b'010010' (-0.00437153614614119+0.04431298065185831j)
a'110000'b'100010' (0.026725487141241646+0.05482468567583641j)
a'110000'b'001100' (0.06606255071869814-0.04835375142247705j)
a'110000'b'010100' (-0.03347446388166432+0.07445804462770325j)
a'110000'b'100100' (-0.12235671295714147+0.037948747737475676j)
a'110000'b'011000' (0.06857007884580876+0.06696090400723377j)
a'110000'b'101000' (-0.016759398625539122+0.07352636935445166j)
a'110000'b'110000' (0.008157257804626818+0.03194762225175787j)

We need to build our Diagoanl Coulomb operator For this bigger system.

tei_compressed = np.random.randn(tedim**2).reshape((tedim, tedim))
tei_compressed = 0.5 * (tei_compressed + tei_compressed.T)
tei_tensor = uncompress_tei(tei_compressed, notation='physics')

diagonal_coulomb = of.FermionOperator()
diagonal_coulomb_mat = np.zeros((norbs, norbs))
for i, j in product(range(norbs), repeat=2):
    diagonal_coulomb_mat[i, j] = tei_tensor[i, j, i, j]
    for sigma, tau in product(range(2), repeat=2):
        diagonal_coulomb += of.FermionOperator(
            ((2 * i + sigma, 1), (2 * i + sigma, 0), (2 * j + tau, 1),
             (2 * j + tau, 0)), coefficient=diagonal_coulomb_mat[i, j])

dc_ham = DiagonalCoulomb(diagonal_coulomb_mat)

Now we can convert our wavefunction to a cirq wavefunction, evolve under the diagonal_coulomb operator we constructed and then compare the outputs.

cirq_wfn = fqe.to_cirq(fqe_wfn).reshape((-1, 1))
final_cirq_wfn = expm(-1j * of.get_sparse_operator(diagonal_coulomb).todense()) @ cirq_wfn
# recover a fqe wavefunction
from_cirq_wfn = fqe.from_cirq(final_cirq_wfn.flatten(), 1.0E-8)
fqe_wfn = fqe_wfn.time_evolve(1, dc_ham)
print("Evolved wavefunction")
fqe_wfn.print_wfn()
Evolved wavefunction
Sector N = 4 : S_z = 0
a'000011'b'000011' (-0.01911004444671768-0.05185884618030289j)
a'000011'b'000101' (-0.002509889642407349-0.018343815130801713j)
a'000011'b'001001' (-0.0274941282320952+0.030080426641447073j)
a'000011'b'010001' (-0.04001107590985773-0.0198127365387817j)
a'000011'b'100001' (-0.004639386890896081+0.06739500632203015j)
a'000011'b'000110' (-0.011535632472380755-0.05632695724494911j)
a'000011'b'001010' (-0.029319437994783742-0.019492336520527936j)
a'000011'b'010010' (-0.06298830323095436+0.0639406193184091j)
a'000011'b'100010' (0.01639308976700676+0.03717511173328825j)
a'000011'b'001100' (0.06837361505620328-0.026454469083388922j)
a'000011'b'010100' (0.016732356756681072-0.038000748334965986j)
a'000011'b'100100' (-0.05417372803065043-0.012621005840673459j)
a'000011'b'011000' (0.04401035386669489+0.12065941438318598j)
a'000011'b'101000' (0.11111056924704953+0.012957703395235286j)
a'000011'b'110000' (-0.026795841295491743-0.04386178865048357j)
a'000101'b'000011' (0.03074872583048526+0.055644010264294566j)
a'000101'b'000101' (-0.03437367275171363+0.018054225435040382j)
a'000101'b'001001' (0.03272869989488609-0.0052639657830443045j)
a'000101'b'010001' (-0.057567493946178425-0.07154016057316555j)
a'000101'b'100001' (-0.015686634669288574-0.017004813086431272j)
a'000101'b'000110' (0.033843585347361343-0.01971034564516001j)
a'000101'b'001010' (-0.07655389237381106-0.016945013755536278j)
a'000101'b'010010' (0.0032899271438195012-0.024357313691964862j)
a'000101'b'100010' (-0.028861474585755973+0.007835230198581523j)
a'000101'b'001100' (0.02433550583620715+0.09006470307506774j)
a'000101'b'010100' (-0.036627453493495096+0.0009083513050577759j)
a'000101'b'100100' (-0.005459207590070795+0.10025280213904038j)
a'000101'b'011000' (0.020528456239923703-0.06784279386146283j)
a'000101'b'101000' (0.05848584802531249+0.09676424681733511j)
a'000101'b'110000' (-0.013085242576030559+0.024811627094607085j)
a'001001'b'000011' (0.029807205077568868+0.015360984501723633j)
a'001001'b'000101' (-0.028987193582582248+0.0647945576138131j)
a'001001'b'001001' (-0.013617748964016777+0.03252054703028444j)
a'001001'b'010001' (0.0004917728495285359-0.07138847940793407j)
a'001001'b'100001' (-0.04083866535298249-0.010293289113542282j)
a'001001'b'000110' (-0.010044124461376517-0.0008706620934293274j)
a'001001'b'001010' (0.03359780975259549+0.049389588143691265j)
a'001001'b'010010' (-0.00330713241050379+0.0860773201795903j)
a'001001'b'100010' (0.028575366380911675-0.05605569564420149j)
a'001001'b'001100' (-0.10347951047175823-0.01697670004728598j)
a'001001'b'010100' (0.1181577838305195-0.001139463555499592j)
a'001001'b'100100' (-0.013171135366627767+0.02891221124168306j)
a'001001'b'011000' (0.019219677860814757-0.012575432864717155j)
a'001001'b'101000' (0.05907285614124482-0.0667745225346924j)
a'001001'b'110000' (0.011532905952611274-0.012574839934344235j)
a'010001'b'000011' (-0.06009848040199788+0.0680305798519057j)
a'010001'b'000101' (-0.09357949447166365-0.0562735742861069j)
a'010001'b'001001' (0.031187883865439758-0.003330457096801329j)
a'010001'b'010001' (0.07676127082081206+0.012950564225148127j)
a'010001'b'100001' (-0.011126776073422948+0.0015826191595305998j)
a'010001'b'000110' (0.09612763613215222-0.015736972095677784j)
a'010001'b'001010' (0.0137183510017448-0.03496143443827197j)
a'010001'b'010010' (-0.033485205099566005-0.009322775350388685j)
a'010001'b'100010' (0.01763441937279364+0.05045652769575324j)
a'010001'b'001100' (-0.045910004223395806+0.03038981602585628j)
a'010001'b'010100' (0.0806167826445725+0.009183227198036858j)
a'010001'b'100100' (0.033232229811074945-0.026527962864468943j)
a'010001'b'011000' (0.03845499401337137-0.062367068323816964j)
a'010001'b'101000' (0.06532262212556514+0.015799840543649767j)
a'010001'b'110000' (0.01646228232556941-0.024620180906950687j)
a'100001'b'000011' (0.029466315162296836+0.01629675852384803j)
a'100001'b'000101' (0.0708739744856275-0.02484417246783067j)
a'100001'b'001001' (-0.022810623552005138+0.0521871904329926j)
a'100001'b'010001' (-0.015116187143728975+0.018736506250235187j)
a'100001'b'100001' (0.0771059735237759-0.0053413488651858415j)
a'100001'b'000110' (0.08599204799199839-0.01977151780695093j)
a'100001'b'001010' (-0.009304245122611968-0.002982317711848231j)
a'100001'b'010010' (-0.052635346687308536-0.0031696253779390526j)
a'100001'b'100010' (0.001833258890352777-0.0067823760230907755j)
a'100001'b'001100' (0.08109059950764617-0.07710928934349716j)
a'100001'b'010100' (0.04665743341755314+0.030257406999127972j)
a'100001'b'100100' (0.027134906765688745+0.051893105059042356j)
a'100001'b'011000' (-0.016241456220361335-0.061480776517104804j)
a'100001'b'101000' (0.0018657979900968994-0.027986903738422872j)
a'100001'b'110000' (-0.017969706237684912-0.04200062627353572j)
a'000110'b'000011' (0.030313491822641106+0.007819798954628027j)
a'000110'b'000101' (0.03694858105714571+0.03362942696285801j)
a'000110'b'001001' (0.08317693184665856+0.00015410953799809034j)
a'000110'b'010001' (0.046207804969256416-0.03127871875068634j)
a'000110'b'100001' (0.002411299550472003+0.014981969621945007j)
a'000110'b'000110' (-0.005159994257682515+0.03849632639101664j)
a'000110'b'001010' (-0.029921350812700368-0.04359580419374644j)
a'000110'b'010010' (-0.04537361339626814+0.019728879945503704j)
a'000110'b'100010' (-0.05609941652986342+0.11956967708085896j)
a'000110'b'001100' (0.06448854779826564-0.09418547875816469j)
a'000110'b'010100' (0.039487611870873116+0.00863361793559539j)
a'000110'b'100100' (-0.05288874892574758-0.025129610526412965j)
a'000110'b'011000' (0.02023756102216494-0.055266096840776116j)
a'000110'b'101000' (-0.010372633269317259-0.0036242548364150405j)
a'000110'b'110000' (0.012917891284209716+0.04593621685438365j)
a'001010'b'000011' (-0.010801181447942034-0.01997884693967918j)
a'001010'b'000101' (-0.024788717464721638+0.030234733473328255j)
a'001010'b'001001' (-0.08156327149052972-0.001901169289347273j)
a'001010'b'010001' (0.07299454666472298-0.10146621409624597j)
a'001010'b'100001' (-0.01062257999878716-0.02802808609810048j)
a'001010'b'000110' (-0.02737661684453677+0.00435092063257618j)
a'001010'b'001010' (0.052061373464169974+0.04081686910546104j)
a'001010'b'010010' (0.10452179580811365+0.00837626779359618j)
a'001010'b'100010' (-0.06285233104216319-0.06152792970436344j)
a'001010'b'001100' (-0.040960697094323366+0.02277108021040626j)
a'001010'b'010100' (0.03208566229557341+0.04787458650496848j)
a'001010'b'100100' (-0.05389400669733064-0.05934537291807282j)
a'001010'b'011000' (-0.04104016432757051-0.08554329213403615j)
a'001010'b'101000' (0.0985272332058762+0.04959374008112903j)
a'001010'b'110000' (-0.032483820102791265+0.017761613281291652j)
a'010010'b'000011' (0.05224348712072776-0.013674318967940854j)
a'010010'b'000101' (0.01666102221439+0.08278834478001719j)
a'010010'b'001001' (0.03017842014707478-0.0017788957038012473j)
a'010010'b'010001' (0.11489001898487285+0.004897157943405694j)
a'010010'b'100001' (-0.012360127073676072-0.0935294663552513j)
a'010010'b'000110' (0.0058738763931152765+0.042742338256283194j)
a'010010'b'001010' (0.0857324962273562-0.03341297670344907j)
a'010010'b'010010' (0.011521388842192913-0.030146897856313807j)
a'010010'b'100010' (-0.010148960133362228+0.014038316693814898j)
a'010010'b'001100' (0.1162411468825759-0.022059399127137943j)
a'010010'b'010100' (0.04522745401387212-0.011361475918607396j)
a'010010'b'100100' (0.00327692442766627-0.06611381426423989j)
a'010010'b'011000' (0.07688550775080591-0.015416820754099904j)
a'010010'b'101000' (-0.05338269505297746+0.03141657698916662j)
a'010010'b'110000' (0.026392906248629368-0.011459073420092558j)
a'100010'b'000011' (-0.018399824880192032+0.02488357808497873j)
a'100010'b'000101' (-0.005996838220614264-0.01374657743663524j)
a'100010'b'001001' (-0.040600962281636885-0.013553604947288552j)
a'100010'b'010001' (0.03209685607189584-0.01213747094080683j)
a'100010'b'100001' (0.05379581890516961+0.023860928463892695j)
a'100010'b'000110' (0.06085208113240709-0.027428516552677105j)
a'100010'b'001010' (-0.07260526098766015+0.08078681344034819j)
a'100010'b'010010' (0.01156211093569442-0.024339470324035144j)
a'100010'b'100010' (-0.029023770534449423+0.015788932483358376j)
a'100010'b'001100' (0.07148394903272236-0.03575911240167473j)
a'100010'b'010100' (-0.017451568565367385+0.024729853398259193j)
a'100010'b'100100' (0.058427284198141624+0.03715987000341887j)
a'100010'b'011000' (-0.07113594863231786-0.05904205533164741j)
a'100010'b'101000' (0.009777869139127237-0.09614049832953392j)
a'100010'b'110000' (0.02028436370930329+0.06941157708526306j)
a'001100'b'000011' (0.010520619883781553+0.03379487114331558j)
a'001100'b'000101' (0.03273223489061064+0.033463259962637985j)
a'001100'b'001001' (0.02765320860208852+0.02313563152474617j)
a'001100'b'010001' (-0.028610058322993535-0.022663887195681246j)
a'001100'b'100001' (0.007864857988815878-0.07876468877333555j)
a'001100'b'000110' (-0.07968692587105797+0.026484505879473267j)
a'001100'b'001010' (-0.09384221579675164+0.03152729709501883j)
a'001100'b'010010' (-0.014543421346156247+0.047132168501082594j)
a'001100'b'100010' (-0.03186894410541929-0.043203981313344256j)
a'001100'b'001100' (-0.01840550243657805-0.012059893589801822j)
a'001100'b'010100' (0.07156747938174166+0.0338825561989754j)
a'001100'b'100100' (0.003868690486380326+0.025470274114833075j)
a'001100'b'011000' (-0.02812929814212171-0.08561180513063249j)
a'001100'b'101000' (0.022892531131708346+0.015830224338399656j)
a'001100'b'110000' (-0.01764149772543275+0.0029218851394807142j)
a'010100'b'000011' (0.001349090904205799-0.049532238151851524j)
a'010100'b'000101' (-0.02198847744575268-0.05083912213169847j)
a'010100'b'001001' (-0.019466644118678152+0.06864675996888146j)
a'010100'b'010001' (-0.06176273976959549+0.1397309663826474j)
a'010100'b'100001' (-0.020065063152932033-0.031761252993865945j)
a'010100'b'000110' (-0.018530863009272206-0.028727794749527063j)
a'010100'b'001010' (0.03279036204915702+0.030328883875523734j)
a'010100'b'010010' (0.013695644105425534+0.01806516097882609j)
a'010100'b'100010' (0.057604460489018246+0.10827626403397679j)
a'010100'b'001100' (-0.028084221527763756+0.01285302825387824j)
a'010100'b'010100' (0.044177466441220996+0.023713616148189988j)
a'010100'b'100100' (-0.008308830893648164+0.08741771308029314j)
a'010100'b'011000' (0.053578330478932915+0.03906002392120933j)
a'010100'b'101000' (0.00031747052777994115-0.029355056901081734j)
a'010100'b'110000' (0.0552057908067732+0.03238642505616872j)
a'100100'b'000011' (0.009423088637523147+0.007296713579486372j)
a'100100'b'000101' (-0.007294288096623182-0.03386500597278041j)
a'100100'b'001001' (-0.06119594733011861-0.009190840778312528j)
a'100100'b'010001' (-0.051267452331000725-0.022229276743282417j)
a'100100'b'100001' (0.022135692799307962-0.060736449063711624j)
a'100100'b'000110' (0.05233480703736715+0.0010997652431480778j)
a'100100'b'001010' (-0.07607694654478678-0.051614936796555155j)
a'100100'b'010010' (0.03963676829991284+0.0667428481702596j)
a'100100'b'100010' (-0.0207753007681048+0.017129859229995784j)
a'100100'b'001100' (-0.027013278159108194+0.04711573633628456j)
a'100100'b'010100' (0.056901494367865374+0.014301491111506102j)
a'100100'b'100100' (-0.0644183699854396+0.01826665230523529j)
a'100100'b'011000' (-0.10520092873713278-0.004639831743382547j)
a'100100'b'101000' (-0.009890391461613211-0.022821089452986523j)
a'100100'b'110000' (0.0005404960958843869-0.012665127114398562j)
a'011000'b'000011' (0.013820611157614267-0.013299584503350078j)
a'011000'b'000101' (0.03102354998286503+0.002978652898471831j)
a'011000'b'001001' (0.029946202766672987+0.0651306563829938j)
a'011000'b'010001' (0.025634781310840984+0.1655650924595544j)
a'011000'b'100001' (-0.010383796730922492+0.009165544875577082j)
a'011000'b'000110' (-0.057272961907941775+0.03594635557853129j)
a'011000'b'001010' (-0.016473207104663407+0.06279553091317389j)
a'011000'b'010010' (-0.10227413445175616+0.01720193560699441j)
a'011000'b'100010' (0.014077439476222609+0.04655726471901834j)
a'011000'b'001100' (0.019476870920979765+0.010814894874738025j)
a'011000'b'010100' (-0.10021930386669421-0.03306090094342854j)
a'011000'b'100100' (0.05102446351270551+0.025706419220147176j)
a'011000'b'011000' (0.02407741721028458-0.001088479824152789j)
a'011000'b'101000' (0.0932549924822978+0.024333692373252655j)
a'011000'b'110000' (-0.004100308446886965+0.031005477890572654j)
a'101000'b'000011' (0.044735180483424404-0.001738953540692062j)
a'101000'b'000101' (-0.042809730472070776+0.03987897141480807j)
a'101000'b'001001' (-0.05345994081819335-0.0025287075401654474j)
a'101000'b'010001' (0.04411463300075627+0.010719267027966144j)
a'101000'b'100001' (0.022294663494275207-0.013996291254466497j)
a'101000'b'000110' (-0.0926985347368032+0.0013458680154597377j)
a'101000'b'001010' (0.04144368406398031+0.018742145222704114j)
a'101000'b'010010' (0.011731308046609889+0.020226334301005976j)
a'101000'b'100010' (-0.0014427835480382632+0.008184475539401123j)
a'101000'b'001100' (0.016785334120229905+0.02956380680213429j)
a'101000'b'010100' (-0.0850176480359706-0.05314143373641023j)
a'101000'b'100100' (-0.02642930485728506-0.007515019946682545j)
a'101000'b'011000' (0.004502106992294407-0.013125737926219736j)
a'101000'b'101000' (-0.034687333273719964-0.06083137475566012j)
a'101000'b'110000' (-0.10287968197009932-0.0645353241680319j)
a'110000'b'000011' (-0.023673632372319748-0.005363569693984821j)
a'110000'b'000101' (0.011879550776671013-0.05088281164979846j)
a'110000'b'001001' (-0.044356738991563505+0.030234391420248558j)
a'110000'b'010001' (-0.14137490016888538+0.051583894077784756j)
a'110000'b'100001' (0.01182841493135423-0.04147806139379926j)
a'110000'b'000110' (0.04701120662384598-0.06492924780996814j)
a'110000'b'001010' (-0.0081983578040061+0.01903268568564591j)
a'110000'b'010010' (-0.035100026339257205+0.02739961192266123j)
a'110000'b'100010' (-0.04739832594779717+0.038384847527863294j)
a'110000'b'001100' (0.08182357834661123+0.0026921943917998107j)
a'110000'b'010100' (0.06346127886701483+0.051353736246828964j)
a'110000'b'100100' (-0.01101037579779159-0.12763245780486357j)
a'110000'b'011000' (-0.0666053591005209-0.06891548822635638j)
a'110000'b'101000' (-0.0412284169296564+0.06314445399408715j)
a'110000'b'110000' (-0.03202566337226019-0.007845272971594545j)
print("From Cirq Evolution")
from_cirq_wfn.print_wfn()
assert np.allclose(from_cirq_wfn.get_coeff((n_elec, sz)),
                   fqe_wfn.get_coeff((n_elec, sz)))
print("Wavefunctions are equivalent")
From Cirq Evolution
Sector N = 4 : S_z = 0
a'000011'b'000011' (-0.0191100444467177-0.051858846180302884j)
a'000011'b'000101' (-0.0025098896424073395-0.018343815130801716j)
a'000011'b'001001' (-0.027494128232095204+0.03008042664144708j)
a'000011'b'010001' (-0.040011075909857724-0.019812736538781708j)
a'000011'b'100001' (-0.004639386890896019+0.06739500632203016j)
a'000011'b'000110' (-0.011535632472380725-0.056326957244949113j)
a'000011'b'001010' (-0.02931943799478376-0.019492336520527932j)
a'000011'b'010010' (-0.06298830323095438+0.06394061931840912j)
a'000011'b'100010' (0.016393089767006715+0.037175111733288274j)
a'000011'b'001100' (0.06837361505620329-0.02645446908338892j)
a'000011'b'010100' (0.01673235675668109-0.038000748334965986j)
a'000011'b'100100' (-0.054173728030650445-0.0126210058406734j)
a'000011'b'011000' (0.04401035386669489+0.12065941438318598j)
a'000011'b'101000' (0.11111056924704951+0.012957703395235345j)
a'000011'b'110000' (-0.026795841295491736-0.043861788650483576j)
a'000101'b'000011' (0.03074872583048524+0.05564401026429458j)
a'000101'b'000101' (-0.03437367275171363+0.01805422543504038j)
a'000101'b'001001' (0.03272869989488608-0.005263965783044307j)
a'000101'b'010001' (-0.05756749394617841-0.07154016057316558j)
a'000101'b'100001' (-0.015686634669288588-0.01700481308643126j)
a'000101'b'000110' (0.033843585347361364-0.01971034564516j)
a'000101'b'001010' (-0.07655389237381106-0.01694501375553626j)
a'000101'b'010010' (0.0032899271438195056-0.02435731369196486j)
a'000101'b'100010' (-0.028861474585755963+0.007835230198581558j)
a'000101'b'001100' (0.0243355058362072+0.09006470307506773j)
a'000101'b'010100' (-0.036627453493495096+0.0009083513050577828j)
a'000101'b'100100' (-0.0054592075900709025+0.10025280213904039j)
a'000101'b'011000' (0.02052845623992371-0.06784279386146283j)
a'000101'b'101000' (0.0584858480253124+0.09676424681733513j)
a'000101'b'110000' (-0.013085242576030573+0.02481162709460708j)
a'001001'b'000011' (0.029807205077568875+0.015360984501723634j)
a'001001'b'000101' (-0.02898719358258224+0.0647945576138131j)
a'001001'b'001001' (-0.013617748964016782+0.03252054703028443j)
a'001001'b'010001' (0.000491772849528567-0.07138847940793407j)
a'001001'b'100001' (-0.040838665352982494-0.010293289113542308j)
a'001001'b'000110' (-0.01004412446137652-0.0008706620934293286j)
a'001001'b'001010' (0.03359780975259546+0.04938958814369131j)
a'001001'b'010010' (-0.003307132410503788+0.0860773201795903j)
a'001001'b'100010' (0.02857536638091172-0.05605569564420148j)
a'001001'b'001100' (-0.10347951047175823-0.01697670004728586j)
a'001001'b'010100' (0.11815778383051953-0.0011394635554995841j)
a'001001'b'100100' (-0.013171135366627782+0.028912211241683063j)
a'001001'b'011000' (0.019219677860814764-0.012575432864717136j)
a'001001'b'101000' (0.05907285614124482-0.06677452253469243j)
a'001001'b'110000' (0.011532905952611285-0.012574839934344231j)
a'010001'b'000011' (-0.06009848040199789+0.06803057985190572j)
a'010001'b'000101' (-0.09357949447166364-0.0562735742861069j)
a'010001'b'001001' (0.031187883865439747-0.003330457096801319j)
a'010001'b'010001' (0.07676127082081206+0.012950564225148004j)
a'010001'b'100001' (-0.011126776073422953+0.0015826191595306j)
a'010001'b'000110' (0.09612763613215222-0.01573697209567776j)
a'010001'b'001010' (0.013718351001744792-0.03496143443827197j)
a'010001'b'010010' (-0.03348520509956599-0.00932277535038872j)
a'010001'b'100010' (0.01763441937279362+0.05045652769575325j)
a'010001'b'001100' (-0.045910004223395785+0.03038981602585626j)
a'010001'b'010100' (0.0806167826445725+0.009183227198036853j)
a'010001'b'100100' (0.03323222981107496-0.026527962864468936j)
a'010001'b'011000' (0.03845499401337137-0.06236706832381693j)
a'010001'b'101000' (0.06532262212556512+0.015799840543649815j)
a'010001'b'110000' (0.016462282325569406-0.024620180906950694j)
a'100001'b'000011' (0.029466315162296856+0.016296758523848008j)
a'100001'b'000101' (0.07087397448562749-0.024844172467830737j)
a'100001'b'001001' (-0.02281062355200517+0.05218719043299261j)
a'100001'b'010001' (-0.015116187143728971+0.018736506250235194j)
a'100001'b'100001' (0.07710597352377592-0.005341348865186033j)
a'100001'b'000110' (0.08599204799199836-0.019771517806951j)
a'100001'b'001010' (-0.00930424512261197-0.002982317711848235j)
a'100001'b'010010' (-0.05263534668730853-0.0031696253779390643j)
a'100001'b'100010' (0.001833258890352781-0.006782376023090774j)
a'100001'b'001100' (0.08109059950764619-0.07710928934349712j)
a'100001'b'010100' (0.04665743341755313+0.03025740699912798j)
a'100001'b'100100' (0.027134906765688804+0.05189310505904234j)
a'100001'b'011000' (-0.016241456220361317-0.0614807765171048j)
a'100001'b'101000' (0.0018657979900969157-0.027986903738422872j)
a'100001'b'110000' (-0.017969706237684888-0.042000626273535735j)
a'000110'b'000011' (0.030313491822641106+0.007819798954628046j)
a'000110'b'000101' (0.036948581057145706+0.03362942696285803j)
a'000110'b'001001' (0.08317693184665859+0.00015410953799809696j)
a'000110'b'010001' (0.04620780496925644-0.03127871875068634j)
a'000110'b'100001' (0.00241129955047202+0.014981969621945007j)
a'000110'b'000110' (-0.005159994257682539+0.03849632639101665j)
a'000110'b'001010' (-0.02992135081270035-0.04359580419374645j)
a'000110'b'010010' (-0.04537361339626816+0.019728879945503694j)
a'000110'b'100010' (-0.05609941652986341+0.11956967708085896j)
a'000110'b'001100' (0.06448854779826567-0.09418547875816463j)
a'000110'b'010100' (0.039487611870873116+0.008633617935595413j)
a'000110'b'100100' (-0.05288874892574757-0.02512961052641298j)
a'000110'b'011000' (0.02023756102216496-0.0552660968407761j)
a'000110'b'101000' (-0.010372633269317257-0.0036242548364150405j)
a'000110'b'110000' (0.012917891284209705+0.04593621685438366j)
a'001010'b'000011' (-0.010801181447942041-0.019978846939679176j)
a'001010'b'000101' (-0.024788717464721634+0.030234733473328255j)
a'001010'b'001001' (-0.08156327149052975-0.0019011692893473459j)
a'001010'b'010001' (0.07299454666472298-0.10146621409624597j)
a'001010'b'100001' (-0.010622579998787154-0.028028086098100494j)
a'001010'b'000110' (-0.027376616844536766+0.0043509206325761645j)
a'001010'b'001010' (0.05206137346417001+0.04081686910546101j)
a'001010'b'010010' (0.10452179580811365+0.00837626779359607j)
a'001010'b'100010' (-0.06285233104216313-0.06152792970436347j)
a'001010'b'001100' (-0.04096069709432336+0.022771080210406268j)
a'001010'b'010100' (0.032085662295573386+0.04787458650496848j)
a'001010'b'100100' (-0.05389400669733063-0.059345372918072806j)
a'001010'b'011000' (-0.04104016432757054-0.08554329213403611j)
a'001010'b'101000' (0.09852723320587625+0.04959374008112892j)
a'001010'b'110000' (-0.032483820102791265+0.017761613281291642j)
a'010010'b'000011' (0.05224348712072775-0.013674318967940847j)
a'010010'b'000101' (0.01666102221439+0.0827883447800172j)
a'010010'b'001001' (0.030178420147074784-0.0017788957038012503j)
a'010010'b'010001' (0.11489001898487283+0.004897157943405818j)
a'010010'b'100001' (-0.012360127073676036-0.09352946635525135j)
a'010010'b'000110' (0.005873876393115263+0.04274233825628319j)
a'010010'b'001010' (0.08573249622735614-0.03341297670344916j)
a'010010'b'010010' (0.011521388842192917-0.030146897856313793j)
a'010010'b'100010' (-0.01014896013336223+0.014038316693814896j)
a'010010'b'001100' (0.1162411468825759-0.02205939912713793j)
a'010010'b'010100' (0.04522745401387212-0.01136147591860738j)
a'010010'b'100100' (0.0032769244276662814-0.0661138142642399j)
a'010010'b'011000' (0.07688550775080588-0.015416820754099985j)
a'010010'b'101000' (-0.053382695052977484+0.031416576989166604j)
a'010010'b'110000' (0.026392906248629368-0.011459073420092558j)
a'100010'b'000011' (-0.018399824880192046+0.024883578084978708j)
a'100010'b'000101' (-0.0059968382206142794-0.013746577436635233j)
a'100010'b'001001' (-0.040600962281636885-0.013553604947288573j)
a'100010'b'010001' (0.03209685607189585-0.012137470940806819j)
a'100010'b'100001' (0.053795818905169615+0.02386092846389273j)
a'100010'b'000110' (0.060852081132407074-0.02742851655267711j)
a'100010'b'001010' (-0.07260526098766021+0.0807868134403481j)
a'100010'b'010010' (0.01156211093569442-0.024339470324035127j)
a'100010'b'100010' (-0.029023770534449402+0.01578893248335838j)
a'100010'b'001100' (0.07148394903272237-0.035759112401674724j)
a'100010'b'010100' (-0.017451568565367392+0.02472985339825918j)
a'100010'b'100100' (0.058427284198141596+0.03715987000341886j)
a'100010'b'011000' (-0.0711359486323178-0.059042055331647456j)
a'100010'b'101000' (0.009777869139127232-0.09614049832953395j)
a'100010'b'110000' (0.020284363709303303+0.06941157708526303j)
a'001100'b'000011' (0.010520619883781552+0.03379487114331558j)
a'001100'b'000101' (0.03273223489061065+0.03346325996263797j)
a'001100'b'001001' (0.02765320860208854+0.023135631524746136j)
a'001100'b'010001' (-0.02861005832299352-0.02266388719568125j)
a'001100'b'100001' (0.007864857988815914-0.07876468877333556j)
a'001100'b'000110' (-0.07968692587105797+0.02648450587947324j)
a'001100'b'001010' (-0.09384221579675164+0.03152729709501884j)
a'001100'b'010010' (-0.014543421346156259+0.047132168501082594j)
a'001100'b'100010' (-0.0318689441054193-0.043203981313344256j)
a'001100'b'001100' (-0.018405502436578052-0.012059893589801807j)
a'001100'b'010100' (0.07156747938174167+0.03388255619897542j)
a'001100'b'100100' (0.00386869048638032+0.02547027411483307j)
a'001100'b'011000' (-0.028129298142121777-0.08561180513063242j)
a'001100'b'101000' (0.022892531131708353+0.01583022433839965j)
a'001100'b'110000' (-0.01764149772543275+0.00292188513948071j)
a'010100'b'000011' (0.0013490909042058012-0.04953223815185152j)
a'010100'b'000101' (-0.021988477445752698-0.05083912213169848j)
a'010100'b'001001' (-0.01946664411867817+0.06864675996888148j)
a'010100'b'010001' (-0.06176273976959549+0.1397309663826474j)
a'010100'b'100001' (-0.020065063152932022-0.031761252993865945j)
a'010100'b'000110' (-0.018530863009272192-0.028727794749527073j)
a'010100'b'001010' (0.032790362049157015+0.030328883875523738j)
a'010100'b'010010' (0.013695644105425533+0.018065160978826086j)
a'010100'b'100010' (0.057604460489018225+0.1082762640339768j)
a'010100'b'001100' (-0.028084221527763763+0.01285302825387824j)
a'010100'b'010100' (0.04417746644122103+0.023713616148189943j)
a'010100'b'100100' (-0.008308830893648055+0.08741771308029316j)
a'010100'b'011000' (0.05357833047893291+0.039060023921209344j)
a'010100'b'101000' (0.00031747052777994673-0.02935505690108174j)
a'010100'b'110000' (0.05520579080677319+0.03238642505616875j)
a'100100'b'000011' (0.009423088637523154+0.0072967135794863615j)
a'100100'b'000101' (-0.0072942880966231465-0.033865005972780415j)
a'100100'b'001001' (-0.06119594733011861-0.009190840778312562j)
a'100100'b'010001' (-0.051267452331000725-0.02222927674328245j)
a'100100'b'100001' (0.022135692799307924-0.060736449063711666j)
a'100100'b'000110' (0.052334807037367134+0.001099765243148091j)
a'100100'b'001010' (-0.07607694654478675-0.051614936796555135j)
a'100100'b'010010' (0.03963676829991282+0.0667428481702596j)
a'100100'b'100010' (-0.020775300768104802+0.01712985922999578j)
a'100100'b'001100' (-0.0270132781591082+0.04711573633628454j)
a'100100'b'010100' (0.0569014943678654+0.01430149111150602j)
a'100100'b'100100' (-0.06441836998543957+0.01826665230523535j)
a'100100'b'011000' (-0.10520092873713277-0.004639831743382589j)
a'100100'b'101000' (-0.009890391461613196-0.02282108945298653j)
a'100100'b'110000' (0.0005404960958843891-0.012665127114398565j)
a'011000'b'000011' (0.013820611157614265-0.01329958450335008j)
a'011000'b'000101' (0.031023549982865023+0.002978652898471835j)
a'011000'b'001001' (0.02994620276667294+0.06513065638299381j)
a'011000'b'010001' (0.025634781310840925+0.16556509245955436j)
a'011000'b'100001' (-0.010383796730922493+0.009165544875577076j)
a'011000'b'000110' (-0.057272961907941775+0.03594635557853127j)
a'011000'b'001010' (-0.016473207104663365+0.0627955309131739j)
a'011000'b'010010' (-0.10227413445175612+0.01720193560699453j)
a'011000'b'100010' (0.01407743947622259+0.04655726471901834j)
a'011000'b'001100' (0.019476870920979765+0.010814894874738003j)
a'011000'b'010100' (-0.10021930386669418-0.03306090094342856j)
a'011000'b'100100' (0.05102446351270548+0.02570641922014718j)
a'011000'b'011000' (0.024077417210284568-0.001088479824152813j)
a'011000'b'101000' (0.09325499248229778+0.024333692373252686j)
a'011000'b'110000' (-0.004100308446886997+0.031005477890572637j)
a'101000'b'000011' (0.044735180483424404-0.0017389535406920377j)
a'101000'b'000101' (-0.0428097304720708+0.03987897141480805j)
a'101000'b'001001' (-0.05345994081819336-0.002528707540165445j)
a'101000'b'010001' (0.04411463300075626+0.010719267027966169j)
a'101000'b'100001' (0.022294663494275214-0.013996291254466489j)
a'101000'b'000110' (-0.09269853473680319+0.0013458680154597377j)
a'101000'b'001010' (0.04144368406398033+0.018742145222704072j)
a'101000'b'010010' (0.011731308046609878+0.020226334301005976j)
a'101000'b'100010' (-0.0014427835480382645+0.008184475539401121j)
a'101000'b'001100' (0.01678533412022991+0.02956380680213428j)
a'101000'b'010100' (-0.08501764803597056-0.05314143373641027j)
a'101000'b'100100' (-0.026429304857285053-0.007515019946682565j)
a'101000'b'011000' (0.00450210699229441-0.013125737926219733j)
a'101000'b'101000' (-0.03468733327371997-0.060831374755660146j)
a'101000'b'110000' (-0.10287968197009936-0.06453532416803186j)
a'110000'b'000011' (-0.023673632372319738-0.0053635696939848265j)
a'110000'b'000101' (0.011879550776671037-0.05088281164979845j)
a'110000'b'001001' (-0.04435673899156353+0.030234391420248523j)
a'110000'b'010001' (-0.14137490016888538+0.051583894077784735j)
a'110000'b'100001' (0.011828414931354277-0.041478061393799254j)
a'110000'b'000110' (0.047011206623845975-0.06492924780996813j)
a'110000'b'001010' (-0.008198357804006108+0.019032685685645905j)
a'110000'b'010010' (-0.0351000263392572+0.02739961192266123j)
a'110000'b'100010' (-0.04739832594779715+0.03838484752786331j)
a'110000'b'001100' (0.08182357834661123+0.0026921943917998306j)
a'110000'b'010100' (0.0634612788670148+0.051353736246829006j)
a'110000'b'100100' (-0.0110103757977916-0.12763245780486357j)
a'110000'b'011000' (-0.06660535910052082-0.06891548822635644j)
a'110000'b'101000' (-0.041228416929656383+0.06314445399408719j)
a'110000'b'110000' (-0.03202566337226019-0.007845272971594546j)
Wavefunctions are equivalent

Finally, we can compare against evolving each term of \(V\) individually.

fqe_wfn = fqe.Wavefunction([[n_elec, sz, norbs]])
fqe_wfn.set_wfn(strategy='from_data',
                raw_data={(n_elec, sz): initial_coeffs})
for term, coeff in diagonal_coulomb.terms.items():
    op = of.FermionOperator(term, coefficient=coeff)
    fqe_wfn = fqe_wfn.time_evolve(1, op)

assert np.allclose(from_cirq_wfn.get_coeff((n_elec, sz)),
               fqe_wfn.get_coeff((n_elec, sz)))
print("Individual term evolution is equivalent")
Individual term evolution is equivalent