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.3164154694711676-0.9486207095985943j)

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')
inital_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.07755130882672079-0.0521029788288075j)
a'000011'b'000101' (0.00729606568943711+0.04030157995842969j)
a'000011'b'001001' (0.0019675845894286453-0.019651089189236002j)
a'000011'b'010001' (-0.03501851040600835-0.03356711387506542j)
a'000011'b'100001' (0.002203425648300094+0.05376838746527553j)
a'000011'b'000110' (0.06005510383278157+0.050240065026224856j)
a'000011'b'001010' (-0.07467577328832449-0.05318371295545603j)
a'000011'b'010010' (-0.01693960370318137-0.03957124103193346j)
a'000011'b'100010' (0.049075732185383726+0.06766906593079004j)
a'000011'b'001100' (0.004067267597673189-0.07362551494888275j)
a'000011'b'010100' (-0.0034342739200662977+0.04793380817623556j)
a'000011'b'100100' (-0.02420022732804581-0.0476454552907348j)
a'000011'b'011000' (0.003607647788623058+0.015070605495686427j)
a'000011'b'101000' (-0.0006063206268975336-0.05855675700248983j)
a'000011'b'110000' (0.041907655497257626+0.040111376787417566j)
a'000101'b'000011' (-0.025205370514722242-0.05633222708195507j)
a'000101'b'000101' (-0.07819721599391916+0.02401376388404783j)
a'000101'b'001001' (0.025051660138818415+0.03696837509801673j)
a'000101'b'010001' (-0.017929033905325208-0.010054380656150552j)
a'000101'b'100001' (-0.08360309705825032-0.027878474957852926j)
a'000101'b'000110' (0.07747510593656334-0.0016869883703255354j)
a'000101'b'001010' (-0.0547711453826215-0.029878120078489348j)
a'000101'b'010010' (0.04135754113180218-0.061026289535831085j)
a'000101'b'100010' (-0.07196268626078758-0.10642530663716299j)
a'000101'b'001100' (-0.019368237016661287-0.05676631869444358j)
a'000101'b'010100' (-0.0008243821059859582-0.01498740783529289j)
a'000101'b'100100' (0.0704723501893401-0.026247028355701127j)
a'000101'b'011000' (0.03584274993807644+0.0025306973437792066j)
a'000101'b'101000' (0.08369447179810495+0.05193752237945902j)
a'000101'b'110000' (0.09625459564636928-0.06365154973926716j)
a'001001'b'000011' (0.012977611560998026+0.023077861980407656j)
a'001001'b'000101' (0.05735511849103496+0.07159804980283337j)
a'001001'b'001001' (-0.007147460311513097+0.04551255830853423j)
a'001001'b'010001' (-0.050544032473888084+0.0031329798563827066j)
a'001001'b'100001' (-0.0005400658381431676-0.01293006510237492j)
a'001001'b'000110' (0.0845461337175251+0.06306742463247375j)
a'001001'b'001010' (-0.011048792333414792-0.07081481771207104j)
a'001001'b'010010' (-0.022664003997382682+0.07215678208447289j)
a'001001'b'100010' (0.04504379426151152+0.05037679391835717j)
a'001001'b'001100' (-0.010015504572692305-0.03538593220722105j)
a'001001'b'010100' (0.08820483974763818+0.011637617618450507j)
a'001001'b'100100' (-0.07519720824474342+0.059163414638140385j)
a'001001'b'011000' (0.08442459096507728-0.03953287149617713j)
a'001001'b'101000' (0.05461730439161116-0.08253077820417548j)
a'001001'b'110000' (-0.0020861207084710174-0.02244964906374737j)
a'010001'b'000011' (-0.025965572514345937+0.017751547087324595j)
a'010001'b'000101' (0.10561045098376157-0.02753168907367661j)
a'010001'b'001001' (-0.04587834267666526-0.022935776146076604j)
a'010001'b'010001' (-0.0023498783217294535-0.028237313909062107j)
a'010001'b'100001' (-0.06615228163631007-0.021405694180431936j)
a'010001'b'000110' (0.10911166422087647+0.07199969210980571j)
a'010001'b'001010' (0.010003794885148621+0.002195700831949571j)
a'010001'b'010010' (-0.010668746483792556+0.012970752532268466j)
a'010001'b'100010' (-0.025785030758772216-0.01399309229061179j)
a'010001'b'001100' (-0.01743793049344051+0.04248037166236875j)
a'010001'b'010100' (0.07384775680583776-0.015605091863508062j)
a'010001'b'100100' (0.07682421434447967-0.051996160235286235j)
a'010001'b'011000' (-0.017505793799450203+0.023698272172276786j)
a'010001'b'101000' (0.010858543404170959-0.013824424805071955j)
a'010001'b'110000' (-0.04426523092267447+0.05830079518975247j)
a'100001'b'000011' (-0.013047393173462101-0.02811107182094255j)
a'100001'b'000101' (-0.06486102788382102+0.011676118035081689j)
a'100001'b'001001' (0.02892990455436064-0.007872548434255321j)
a'100001'b'010001' (-0.03242382321676398-0.06156515736046983j)
a'100001'b'100001' (0.02050799378446632+0.010608967286535076j)
a'100001'b'000110' (-0.05237716996116473+0.002730908587795929j)
a'100001'b'001010' (-0.0010605773458386447-0.027923256740611493j)
a'100001'b'010010' (-0.03081429652232543-0.0003569537387061529j)
a'100001'b'100010' (0.06176763277962899-0.0334226792180411j)
a'100001'b'001100' (0.042745077168654666-0.03347564297372142j)
a'100001'b'010100' (0.06667404874994477-0.01831920691067528j)
a'100001'b'100100' (-0.030233167858546746-0.028038878691043146j)
a'100001'b'011000' (0.008303712130467883-0.01806924371860903j)
a'100001'b'101000' (-0.07171678676662331-0.0679157684693942j)
a'100001'b'110000' (-0.04640483896321662+0.03403592796444072j)
a'000110'b'000011' (0.044693150827418274+0.006841717415615491j)
a'000110'b'000101' (-0.00972295369660916+0.029645464535702944j)
a'000110'b'001001' (-0.011760182549708002+0.0929865945320646j)
a'000110'b'010001' (0.042825807607342656+0.05066138353845957j)
a'000110'b'100001' (-0.007017748315071313-0.03755374070636558j)
a'000110'b'000110' (-0.01970138925133297+0.02894948682012575j)
a'000110'b'001010' (-0.03798198330617933+0.028475992472551732j)
a'000110'b'010010' (0.021000883598604952+0.021053515754065326j)
a'000110'b'100010' (-0.0691078535662072-0.0223356781836602j)
a'000110'b'001100' (-0.045343401142404115-0.03508511401229176j)
a'000110'b'010100' (0.011187273139768035-0.05788872428930977j)
a'000110'b'100100' (-0.046997487386520966+0.015649323278246766j)
a'000110'b'011000' (0.023465528347631444-0.04102380770400408j)
a'000110'b'101000' (0.05633939699675901+0.06222899943660605j)
a'000110'b'110000' (0.05882003129546273-0.0038279432917160006j)
a'001010'b'000011' (-0.09332834608643642-0.0723252464449073j)
a'001010'b'000101' (0.06712355549522522+0.020558081376135275j)
a'001010'b'001001' (-0.017147762559213214+0.004850285280430263j)
a'001010'b'010001' (0.02332119217682906-0.06247230348326962j)
a'001010'b'100001' (0.04637285169618979-0.07220992354869786j)
a'001010'b'000110' (0.0417948956016906-0.02599382564102773j)
a'001010'b'001010' (0.015545749055700137-0.012479721794206849j)
a'001010'b'010010' (-0.12491445217573167+0.012302608174633259j)
a'001010'b'100010' (0.0004093389082115574-0.02669457771929088j)
a'001010'b'001100' (-0.01098197917503154-0.008463353401831627j)
a'001010'b'010100' (0.07663286127715918+0.029503667250860514j)
a'001010'b'100100' (-0.04682722636034232+0.08434963813133668j)
a'001010'b'011000' (-0.015441740935450839+0.08683139930905277j)
a'001010'b'101000' (0.04011414993675089-0.008762234226246161j)
a'001010'b'110000' (0.035238087066936645-0.030718153752091876j)
a'010010'b'000011' (0.0024882978350197777+0.0014525363811122246j)
a'010010'b'000101' (0.04689653786298456+0.035196076952646496j)
a'010010'b'001001' (-0.07206819061099275-0.09493127014082808j)
a'010010'b'010001' (0.02451555026725638-0.11618821599654636j)
a'010010'b'100001' (-0.03371998559223423+0.15935541715720153j)
a'010010'b'000110' (0.05050918180534701-0.020199029001359926j)
a'010010'b'001010' (-0.0373248129257711+0.048617452340919486j)
a'010010'b'010010' (0.07112185351294253+0.07591066770410698j)
a'010010'b'100010' (0.001019290576550746-0.014478487944673598j)
a'010010'b'001100' (0.011083062254069654+0.003930161190288417j)
a'010010'b'010100' (-0.023445728947215565+0.02076209800309433j)
a'010010'b'100100' (0.038822480560668934+0.025389439082992127j)
a'010010'b'011000' (0.02328198598348105-0.0378598849168721j)
a'010010'b'101000' (0.05383400996511549-0.048985993444576464j)
a'010010'b'110000' (-0.012249202364344328-0.06612210963438477j)
a'100010'b'000011' (-0.012980259668395057+0.02946392396282604j)
a'100010'b'000101' (0.06430656517595475-0.055883073846386154j)
a'100010'b'001001' (0.056298064909285496+0.016704220645570814j)
a'100010'b'010001' (0.022369282277430298+0.10099127221809039j)
a'100010'b'100001' (-0.02210318131622536+0.01866274331104012j)
a'100010'b'000110' (0.011324055125016433+0.0013069321299389392j)
a'100010'b'001010' (-0.15319675693275348+0.0075179542076351065j)
a'100010'b'010010' (-0.03478053962339168-0.011082631386443288j)
a'100010'b'100010' (0.02833637701737148+0.020390776343060503j)
a'100010'b'001100' (-0.05229883902986439+0.03000751151064523j)
a'100010'b'010100' (0.013420297504587562+0.04998402719659549j)
a'100010'b'100100' (0.02237328434968523+0.07053423344882188j)
a'100010'b'011000' (0.021642356305078596+0.012179629718526428j)
a'100010'b'101000' (-0.01102116972068311-0.07225116127648107j)
a'100010'b'110000' (-0.01216757897874861-0.004194764201338775j)
a'001100'b'000011' (-0.048097118649353045-0.016483329681344305j)
a'001100'b'000101' (0.01966629453211589+0.08574708560509016j)
a'001100'b'001001' (-0.02056173058850753-0.008753888337980917j)
a'001100'b'010001' (0.05019253818715932-0.015040322149131131j)
a'001100'b'100001' (-0.022147644875314242+0.04066618120667741j)
a'001100'b'000110' (-0.07641261165389163-0.03490521201766838j)
a'001100'b'001010' (0.015651406073309785+0.040502173874362286j)
a'001100'b'010010' (-0.031026025340468173-0.02354708031498951j)
a'001100'b'100010' (-0.09093430905661766-0.0038310965368160716j)
a'001100'b'001100' (-0.0337980528441397+0.0802541333874766j)
a'001100'b'010100' (-0.002174416346275123+0.01347981014530172j)
a'001100'b'100100' (0.026770428719239528+0.006987560330104767j)
a'001100'b'011000' (-0.030677316664655698-0.054667991117205064j)
a'001100'b'101000' (0.03978202821884522-0.011496879035596269j)
a'001100'b'110000' (0.04994316037953157-0.012480747147175317j)
a'010100'b'000011' (0.04856851233052511-0.004765929823407257j)
a'010100'b'000101' (-0.0433325216389192+0.023801993209175386j)
a'010100'b'001001' (0.07605696586461665+0.013179769526570698j)
a'010100'b'010001' (-0.008317938033350337-0.06976325913090621j)
a'010100'b'100001' (0.05424758038322179-0.026113859391990246j)
a'010100'b'000110' (-0.037398552382257574-0.009689879278265872j)
a'010100'b'001010' (-0.024267902938046246+0.03849530047647555j)
a'010100'b'010010' (0.06573684105523069-0.0879118063482728j)
a'010100'b'100010' (0.06316235684604823+0.05278770349485618j)
a'010100'b'001100' (0.039084324164674035-0.020293206031266196j)
a'010100'b'010100' (-0.03785596042703529-0.08207179731557832j)
a'010100'b'100100' (0.004844513058441531+0.027771759342267364j)
a'010100'b'011000' (-0.07850258072935686+0.10873293643707159j)
a'010100'b'101000' (-0.015838800723703167+0.04566832300447145j)
a'010100'b'110000' (-0.028909645387054705-0.0685228173873293j)
a'100100'b'000011' (-0.07106257555969223+0.035978680865492246j)
a'100100'b'000101' (0.003509809559350286-0.02257169265227213j)
a'100100'b'001001' (-0.07759866184092717+0.04326508612431477j)
a'100100'b'010001' (0.06050699381905353+0.004677430339917541j)
a'100100'b'100001' (0.060335512752934674+0.04528574560424116j)
a'100100'b'000110' (0.001669205092065581-0.021605702624835695j)
a'100100'b'001010' (0.007905212163445415-0.10505369974619383j)
a'100100'b'010010' (0.017871982296372727+0.048623254694118954j)
a'100100'b'100010' (0.004477344891694709+0.08851072410826573j)
a'100100'b'001100' (-0.00969564703278022+0.08163522116284036j)
a'100100'b'010100' (0.0055505139631643685+0.03666470057710561j)
a'100100'b'100100' (0.044429140183016205+0.035353198224312654j)
a'100100'b'011000' (0.04049091566758151+0.014337063416974594j)
a'100100'b'101000' (-0.05613427514892131+0.00013282415935280583j)
a'100100'b'110000' (0.016841008483521925+0.01160036225062565j)
a'011000'b'000011' (-0.027871902125936064-0.04767841396068725j)
a'011000'b'000101' (0.05803553948463912-0.01711394871414659j)
a'011000'b'001001' (-0.05508809854418824+0.0014315857663627406j)
a'011000'b'010001' (0.01930797384818517+0.00462354859650121j)
a'011000'b'100001' (0.06685359708983418+0.05115048080753705j)
a'011000'b'000110' (0.023881720167682637+0.005785024409000959j)
a'011000'b'001010' (0.00657832644193747-0.03647432367167494j)
a'011000'b'010010' (0.06779293170049033+0.05296206531893719j)
a'011000'b'100010' (-0.024690245309502673+0.06773061242655891j)
a'011000'b'001100' (-0.0817836603427191-0.004021853331486826j)
a'011000'b'010100' (0.038002502626849705+0.005943334872856569j)
a'011000'b'100100' (0.021191877615097023+0.061711460077914546j)
a'011000'b'011000' (-0.0024867093914499403-0.02005671088712732j)
a'011000'b'101000' (-0.029329111846359217-0.07252936670490848j)
a'011000'b'110000' (0.03514820123694287+0.07028196934483422j)
a'101000'b'000011' (0.008179563688510732-0.025073657899691525j)
a'101000'b'000101' (0.01645811700693844-0.03301982162443189j)
a'101000'b'001001' (0.03806355186331015+0.04441420716644585j)
a'101000'b'010001' (0.05943376020687298-0.020288990441505134j)
a'101000'b'100001' (0.01314186230430265+0.014860243037110442j)
a'101000'b'000110' (-0.013990843846178838-0.010396003386534656j)
a'101000'b'001010' (0.003036968582336228+0.016328148324309122j)
a'101000'b'010010' (0.06163067928313048-0.060405982290605176j)
a'101000'b'100010' (-0.06876579562792383+0.08543706429289374j)
a'101000'b'001100' (-0.10508334198201957-0.011762804412599184j)
a'101000'b'010100' (-0.007953652157133943+0.01240621226153465j)
a'101000'b'100100' (0.006839692088624856+0.03721531638855642j)
a'101000'b'011000' (-0.04749861331141861-0.006409241543558538j)
a'101000'b'101000' (-0.07081823140117867-0.007101119118577295j)
a'101000'b'110000' (0.0028675625725205676+0.012988709648911275j)
a'110000'b'000011' (0.08182735127204778-0.010677167647515065j)
a'110000'b'000101' (0.014025803717156893+0.04424499271411471j)
a'110000'b'001001' (-0.00814266869161166-0.09323812109638092j)
a'110000'b'010001' (0.09566596324256216+0.031102581284247154j)
a'110000'b'100001' (-0.03874544740438333+0.053097874698781494j)
a'110000'b'000110' (-0.08266012937538264+0.04525964367302778j)
a'110000'b'001010' (-0.0041570271878454855-0.03969745939199273j)
a'110000'b'010010' (0.0373878554550202+0.11940259772358341j)
a'110000'b'100010' (0.04029614760849126+0.035380471745349716j)
a'110000'b'001100' (0.02689262820326438+0.062249888286305226j)
a'110000'b'010100' (-0.06803315150811146+0.02444699180476292j)
a'110000'b'100100' (0.016208843699709447-0.08380886746938634j)
a'110000'b'011000' (0.038511750456291315+0.05705005004890579j)
a'110000'b'101000' (0.028247144540361434-0.031293350136939596j)
a'110000'b'110000' (0.023131178883373776-0.03321805361708107j)

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.0933880422843764+0.002756712147487969j)
a'000011'b'000101' (-0.030944601301101854+0.026830608863872774j)
a'000011'b'001001' (0.019676074967920593-0.0016996379898771173j)
a'000011'b'010001' (-0.046570179966634394-0.01357444447602216j)
a'000011'b'100001' (-0.052167565659882835+0.013207561028645638j)
a'000011'b'000110' (0.041275592210680265-0.0665357431600723j)
a'000011'b'001010' (-0.023517441615457893-0.08861099468915304j)
a'000011'b'010010' (0.034868756107414564+0.025238921093221286j)
a'000011'b'100010' (0.06469021674890416+0.05294058774189157j)
a'000011'b'001100' (0.04463952267751161+0.05869047735640909j)
a'000011'b'010100' (0.0023524599525577747+0.04799906390551599j)
a'000011'b'100100' (0.05334439698231584+0.0031805224702235757j)
a'000011'b'011000' (-0.0117651185490519+0.010085646141924958j)
a'000011'b'101000' (0.005832251683735682-0.058268741668658024j)
a'000011'b'110000' (0.03877757842612793+0.04314479746695428j)
a'000101'b'000011' (0.03559931152081067-0.050411501961771195j)
a'000101'b'000101' (-0.05485417802974307+0.060683478787555485j)
a'000101'b'001001' (0.00526841432068854+0.0443451264925932j)
a'000101'b'010001' (-0.012120447640498449-0.0166022762340292j)
a'000101'b'100001' (-0.01564755136895489-0.08672854973918785j)
a'000101'b'000110' (0.0613976857446375-0.04728173172427237j)
a'000101'b'001010' (0.0610708571988631-0.012764436021421539j)
a'000101'b'010010' (0.0337220660906739-0.06555514077138434j)
a'000101'b'100010' (0.12820003362649085-0.008350178731580725j)
a'000101'b'001100' (0.03489340779376875-0.04878517844376981j)
a'000101'b'010100' (0.0023219796309415534-0.014829376590793055j)
a'000101'b'100100' (0.04840690788964882+0.05755023811659703j)
a'000101'b'011000' (-0.02009399267259782+0.029788229397580444j)
a'000101'b'101000' (0.088299312716545+0.04365205853412169j)
a'000101'b'110000' (0.052165039261663514+0.10293335536202812j)
a'001001'b'000011' (-0.0202805424189255+0.017020743656170206j)
a'001001'b'000101' (0.018052490447441304+0.08994441584297888j)
a'001001'b'001001' (-0.034827814625079556+0.030157958835661903j)
a'001001'b'010001' (-0.045134142980431426+0.022965711809650617j)
a'001001'b'100001' (-0.0016087193483649935+0.012840960895485167j)
a'001001'b'000110' (-0.1052582063761332+0.006801379774262556j)
a'001001'b'001010' (-0.07085050414700822+0.010817591309323386j)
a'001001'b'010010' (-0.07454992087337359+0.012750199047592264j)
a'001001'b'100010' (0.03923499933773187+0.05502162841950597j)
a'001001'b'001100' (-0.016907083113453132+0.0326592264240054j)
a'001001'b'010100' (-0.054135788046502833+0.0706034301668405j)
a'001001'b'100100' (-0.06916203876922586+0.066117638741352j)
a'001001'b'011000' (-0.08610035138400379+0.03573638174053083j)
a'001001'b'101000' (-0.09880990786413271+0.005566093591947398j)
a'001001'b'110000' (-0.02254440335454496+0.0002975232483466932j)
a'010001'b'000011' (-0.014817000769089357+0.02774499717426666j)
a'010001'b'000101' (0.10749049780043102+0.018903812918526313j)
a'010001'b'001001' (-0.051215014958735594-0.0028096969510876387j)
a'010001'b'010001' (-0.0033155639719746307-0.02814027115138711j)
a'010001'b'100001' (-0.0682939464916194+0.013048562435597582j)
a'010001'b'000110' (0.11697516629024715+0.058361985952545756j)
a'010001'b'001010' (0.0026098876867509118+0.009903812423006395j)
a'010001'b'010010' (0.005735434792088907+0.01578503596874207j)
a'010001'b'100010' (-0.02466156637457484-0.015889669192177918j)
a'010001'b'001100' (-0.02809333239275238-0.036323932489990336j)
a'010001'b'010100' (0.0001485798271465508+0.07547839426854314j)
a'010001'b'100100' (0.04282045574381666+0.082291975056818j)
a'010001'b'011000' (-0.01893220843294831-0.022575039409745853j)
a'010001'b'101000' (-0.01291887007927041-0.011921639229832665j)
a'010001'b'110000' (-0.07162761451299021+0.015095636044023857j)
a'100001'b'000011' (0.024829235750333016-0.018546586737172993j)
a'100001'b'000101' (-0.04136157897408958-0.0513079375465933j)
a'100001'b'001001' (-0.029834188883838653+0.0029728050756063808j)
a'100001'b'010001' (-0.0580372981002739-0.03838287302992466j)
a'100001'b'100001' (-0.016025778797850866+0.01662234670173964j)
a'100001'b'000110' (0.024099703765281318-0.04658358158494601j)
a'100001'b'001010' (0.0020143794514765802-0.027870690101504142j)
a'100001'b'010010' (-0.030700509202217837-0.0026696480782887793j)
a'100001'b'100010' (-0.06523825798836044-0.026005492495919037j)
a'100001'b'001100' (0.03932936464647435-0.03742941852557906j)
a'100001'b'010100' (0.01053351485961124+0.06833788980681575j)
a'100001'b'100100' (-0.018307279147716442+0.0369468088909135j)
a'100001'b'011000' (-0.017353092889698815-0.009711816043853795j)
a'100001'b'101000' (-0.03558387205167899+0.09213922704650511j)
a'100001'b'110000' (0.008025813429095387-0.0569863123074657j)
a'000110'b'000011' (0.0004751754105534426-0.04521129323970618j)
a'000110'b'000101' (0.009741461250540262+0.02963938813181287j)
a'000110'b'001001' (-0.05133567343455602-0.07841847543336755j)
a'000110'b'010001' (0.04860498508167096+0.0451462180527071j)
a'000110'b'100001' (0.03595556787743489+0.012912372789917383j)
a'000110'b'000110' (-0.025354230992117918-0.02415327092506314j)
a'000110'b'001010' (-0.047367688143462594+0.003132941606762489j)
a'000110'b'010010' (-0.025201573876768926+0.015785066096237588j)
a'000110'b'100010' (-0.06758268647895634+0.026596210871841604j)
a'000110'b'001100' (0.042296385927693775-0.03870406942263406j)
a'000110'b'010100' (-0.05704112881467963-0.014918750071457812j)
a'000110'b'100100' (-0.03556484262049245-0.03447908219620815j)
a'000110'b'011000' (0.008877636649426611+0.046419515149227465j)
a'000110'b'101000' (-0.07429981823045385+0.0390654967427915j)
a'000110'b'110000' (0.03027736936676387+0.050574006521852274j)
a'001010'b'000011' (-0.025651942885523554-0.11525232875193488j)
a'001010'b'000101' (-0.06443236565664402+0.027868919391984073j)
a'001010'b'001001' (0.004794288515894192+0.017163502722785877j)
a'001010'b'010001' (0.06623176339467256-0.0077472720803161985j)
a'001010'b'100001' (0.05402726727434328-0.0666765987750746j)
a'001010'b'000110' (0.049208086171080315+0.0010278741128674598j)
a'001010'b'001010' (-0.0091454887005327-0.0177136615693095j)
a'001010'b'010010' (-0.03200443467465008+0.12137005681558273j)
a'001010'b'100010' (-0.015227311608269456-0.0219293643122116j)
a'001010'b'001100' (-0.006087440177442825-0.012456937404160642j)
a'001010'b'010100' (-0.07738707311343275+0.027464572155962014j)
a'001010'b'100100' (-0.07002902303518471-0.0663595246684887j)
a'001010'b'011000' (0.04430561803075794+0.07625714051810711j)
a'001010'b'101000' (0.0009569992382240888+0.041048823688892344j)
a'001010'b'110000' (0.03444183732033715-0.03160834687346992j)
a'010010'b'000011' (-0.002881043098851678+3.2843824043976925e-05j)
a'010010'b'000101' (0.05078720854640437+0.02930372919024113j)
a'010010'b'001001' (0.0515990123940765-0.10743980672194642j)
a'010010'b'010001' (-0.08753778364614191-0.08023621486391125j)
a'010010'b'100001' (-0.04559005376037036+0.1563736979284328j)
a'010010'b'000110' (0.008443792590563996+0.05373900432582383j)
a'010010'b'001010' (0.0325605452767939+0.051928886213197765j)
a'010010'b'010010' (0.033392979353498+0.09851729009821909j)
a'010010'b'100010' (-0.0006703879816276397+0.014498832587404859j)
a'010010'b'001100' (-0.010972962645584495+0.0042278276558819225j)
a'010010'b'010100' (-0.01373360595633166+0.02814524803217422j)
a'010010'b'100100' (-0.004848679139045608+0.04613349026942433j)
a'010010'b'011000' (0.0347169231627768+0.027751702711070896j)
a'010010'b'101000' (0.0525650070789329-0.05034528988364228j)
a'010010'b'110000' (-0.03295412987105112-0.05861912371834085j)
a'100010'b'000011' (-0.005049101152409251+0.03179805864984367j)
a'100010'b'000101' (0.015747564514521042+0.0837273341216055j)
a'100010'b'001001' (0.05412144479290252+0.02278974140780988j)
a'100010'b'010001' (0.014723172113178465+0.10238579030686591j)
a'100010'b'100001' (0.028491003880539496+0.005011118644653168j)
a'100010'b'000110' (0.009580861261552429-0.00617651953397394j)
a'100010'b'001010' (-0.12009840592875273+0.09540513017418817j)
a'100010'b'010010' (0.03503729954849813+0.010241986881992645j)
a'100010'b'100010' (-0.03445166992330285+0.005640608286268855j)
a'100010'b'001100' (-0.01603653837732366-0.058124424709461005j)
a'100010'b'010100' (-0.03833169929857628+0.034773383338196524j)
a'100010'b'100100' (0.06830116944795447+0.028470900808484887j)
a'100010'b'011000' (0.02194644282960731+0.011622762737110567j)
a'100010'b'101000' (0.058738861698570406-0.04349071871294378j)
a'100010'b'110000' (0.012838141577415677+0.0009100251354491756j)
a'001100'b'000011' (0.04730502482364165-0.018635117552311817j)
a'001100'b'000101' (-0.05828817144587921+0.06589244949071471j)
a'001100'b'001001' (0.009005969789005188+0.020452575240974692j)
a'001100'b'010001' (-0.012038384278997992+0.05099587712717829j)
a'001100'b'100001' (-0.018136133318303195+0.042606773354926686j)
a'001100'b'000110' (0.04741162749132529-0.06934982786129065j)
a'001100'b'001010' (-0.003941456684534216+0.04324184917212324j)
a'001100'b'010010' (0.038881147832726816-0.0023098880920041707j)
a'001100'b'100010' (0.02635821440081468-0.08711469679611787j)
a'001100'b'001100' (0.04486434698864544+0.07463393779717489j)
a'001100'b'010100' (-0.0017818674894090213-0.013537293534917344j)
a'001100'b'100100' (0.0076010367394153+0.026602745979781812j)
a'001100'b'011000' (-0.00812889980149041-0.06215792788174093j)
a'001100'b'101000' (0.008591827950760663+0.04050886926623179j)
a'001100'b'110000' (0.007357393098136167+0.05095053566790869j)
a'010100'b'000011' (0.047643469142682526-0.010569499757901024j)
a'010100'b'000101' (-0.047346125927955125+0.014233294486212493j)
a'010100'b'001001' (-0.04940460999918481+0.059308961313897866j)
a'010100'b'010001' (0.06998791938656763+0.006147483845601666j)
a'010100'b'100001' (0.019704934239349894+0.05688979870241802j)
a'010100'b'000110' (-0.012095384435559174+0.036691240863070615j)
a'010100'b'001010' (-0.006623016574260173-0.04502171612945967j)
a'010100'b'010010' (0.02715812197480347-0.1063590822550598j)
a'010100'b'100010' (-0.01810074858785873+0.08030185466829218j)
a'010100'b'001100' (-0.03162474580927113+0.030647578353529496j)
a'010100'b'010100' (0.08922634069527646-0.014405338614315146j)
a'010100'b'100100' (-0.026130291860788194-0.010580537368595763j)
a'010100'b'011000' (0.11719817027794624+0.06519275673645787j)
a'010100'b'101000' (-0.04382896718617332-0.020383448427566377j)
a'010100'b'110000' (0.0258334373168725+0.0697407887501837j)
a'100100'b'000011' (0.004843513382047067-0.07950405964550387j)
a'100100'b'000101' (0.022438185823216487-0.004281108418896815j)
a'100100'b'001001' (-0.07308056765052517+0.05052376301032965j)
a'100100'b'010001' (-0.011601771218319857+0.059568226095809904j)
a'100100'b'100001' (0.026303280117521432-0.07070580109970323j)
a'100100'b'000110' (0.01993950713008857-0.008485793242906464j)
a'100100'b'001010' (0.09977448072857889+0.033820484991421665j)
a'100100'b'010010' (-0.03508745963517419+0.038111662579859255j)
a'100100'b'100010' (0.07046838521986182+0.053743851592101946j)
a'100100'b'001100' (-0.07521699288787603+0.03317708375664337j)
a'100100'b'010100' (-0.034050441821714024-0.014685907714886393j)
a'100100'b'100100' (0.052982287974486605-0.02041260108556041j)
a'100100'b'011000' (-0.018364973638407583+0.03883031524829724j)
a'100100'b'101000' (0.0003603266401285542-0.0561332758126989j)
a'100100'b'110000' (0.018065890331016785-0.009581835817601572j)
a'011000'b'000011' (0.029712489765697386-0.04655364688021492j)
a'011000'b'000101' (-0.014159068470351307+0.058826285484598215j)
a'011000'b'001001' (0.05509722783427736+0.001021530223918946j)
a'011000'b'010001' (-0.009022467655745343+0.017685308398426077j)
a'011000'b'100001' (0.05629580326064091-0.06258240700014114j)
a'011000'b'000110' (-0.021898145473127073+0.011147837925714613j)
a'011000'b'001010' (-0.018540843145605775-0.032091865036685624j)
a'011000'b'010010' (-0.060880472681805395+0.060781822919641584j)
a'011000'b'100010' (-0.02295188999583369+0.06833926264410016j)
a'011000'b'001100' (-0.07441248144636743-0.0341690650774537j)
a'011000'b'010100' (0.0014401806427569266-0.03843747279713978j)
a'011000'b'100100' (-0.0635407226540164+0.01483160633264844j)
a'011000'b'011000' (0.0029968229858670674-0.019986856361086804j)
a'011000'b'101000' (0.0031987627274705456-0.07816951933666143j)
a'011000'b'110000' (-0.03156273891059334+0.07196349614660592j)
a'101000'b'000011' (0.01088541102194093-0.02402293507231315j)
a'101000'b'000101' (0.013207942180753196-0.03444892594658442j)
a'101000'b'001001' (0.012842599018810952-0.057065956831695255j)
a'101000'b'010001' (-0.015507219362040728-0.06085672627673225j)
a'101000'b'100001' (0.0087545304080157-0.01780150457917445j)
a'101000'b'000110' (0.013552932496428766-0.010960776372513277j)
a'101000'b'001010' (-0.016607667078916023-0.00013038430359928603j)
a'101000'b'010010' (0.06006738816961663-0.06196073114379454j)
a'101000'b'100010' (-0.10766335518992864-0.020900443836835467j)
a'101000'b'001100' (0.019326267034677148-0.10395849042893753j)
a'101000'b'010100' (-0.01153670500053896-0.009169466889927314j)
a'101000'b'100100' (-0.0372739676908869+0.006512487569759661j)
a'101000'b'011000' (-0.04062606904854713-0.025430673552504068j)
a'101000'b'101000' (0.06645293715753275+0.02548832938158393j)
a'101000'b'110000' (0.006858513178193177+0.011396942152858023j)
a'110000'b'000011' (0.08239806055410813-0.004502992570921413j)
a'110000'b'000101' (-0.04556398112741131+0.008846817168065721j)
a'110000'b'001001' (-0.09359026539966227+0.0007158920487926421j)
a'110000'b'010001' (0.051958586868320576+0.08613740381691123j)
a'110000'b'100001' (-0.01096952170068224-0.06480944056039674j)
a'110000'b'000110' (-0.07802404236319818-0.052852446935504276j)
a'110000'b'001010' (-0.005169811580703338-0.039578304731752015j)
a'110000'b'010010' (0.07395784981427675+0.10092110051676134j)
a'110000'b'100010' (-0.0480665436285974-0.023773192394143217j)
a'110000'b'001100' (-0.06465385725903647+0.020448491016811732j)
a'110000'b'010100' (0.06905312772293788-0.02139697791996384j)
a'110000'b'100100' (-0.06685534428563097-0.053075567081591564j)
a'110000'b'011000' (-0.019238525638727202+0.06608889668498288j)
a'110000'b'101000' (0.016797713262624338-0.03866538201833549j)
a'110000'b'110000' (-0.037391571911615136+0.015503576123605247j)
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.09338804228437642+0.0027567121474877596j)
a'000011'b'000101' (-0.03094460130110187+0.02683060886387275j)
a'000011'b'001001' (0.019676074967920603-0.001699637989877089j)
a'000011'b'010001' (-0.0465701799666344-0.013574444476022168j)
a'000011'b'100001' (-0.05216756565988285+0.01320756102864555j)
a'000011'b'000110' (0.04127559221068027-0.0665357431600723j)
a'000011'b'001010' (-0.023517441615457733-0.08861099468915308j)
a'000011'b'010010' (0.03486875610741452+0.025238921093221338j)
a'000011'b'100010' (0.06469021674890418+0.052940587741891525j)
a'000011'b'001100' (0.044639522677511555+0.05869047735640912j)
a'000011'b'010100' (0.0023524599525577795+0.047999063905515976j)
a'000011'b'100100' (0.053344396982315835+0.003180522470223539j)
a'000011'b'011000' (-0.011765118549051896+0.010085646141924958j)
a'000011'b'101000' (0.005832251683735792-0.058268741668658024j)
a'000011'b'110000' (0.0387775784261279+0.04314479746695433j)
a'000101'b'000011' (0.0355993115208107-0.050411501961771146j)
a'000101'b'000101' (-0.054854178029743114+0.060683478787555464j)
a'000101'b'001001' (0.005268414320688548+0.0443451264925932j)
a'000101'b'010001' (-0.01212044764049845-0.0166022762340292j)
a'000101'b'100001' (-0.015647551368954894-0.08672854973918781j)
a'000101'b'000110' (0.0613976857446375-0.04728173172427236j)
a'000101'b'001010' (0.061070857198863085-0.012764436021421487j)
a'000101'b'010010' (0.03372206609067388-0.06555514077138436j)
a'000101'b'100010' (0.1282000336264908-0.008350178731580796j)
a'000101'b'001100' (0.034893407793768746-0.04878517844376981j)
a'000101'b'010100' (0.002321979630941549-0.014829376590793057j)
a'000101'b'100100' (0.048406907889648826+0.05755023811659703j)
a'000101'b'011000' (-0.02009399267259781+0.029788229397580444j)
a'000101'b'101000' (0.088299312716545+0.04365205853412169j)
a'000101'b'110000' (0.05216503926166352+0.10293335536202809j)
a'001001'b'000011' (-0.02028054241892552+0.017020743656170175j)
a'001001'b'000101' (0.01805249044744131+0.08994441584297887j)
a'001001'b'001001' (-0.034827814625079584+0.030157958835661865j)
a'001001'b'010001' (-0.04513414298043142+0.022965711809650624j)
a'001001'b'100001' (-0.001608719348364993+0.012840960895485164j)
a'001001'b'000110' (-0.1052582063761332+0.006801379774262477j)
a'001001'b'001010' (-0.07085050414700825+0.01081759130932313j)
a'001001'b'010010' (-0.07454992087337359+0.012750199047592305j)
a'001001'b'100010' (0.03923499933773176+0.055021628419506044j)
a'001001'b'001100' (-0.01690708311345314+0.0326592264240054j)
a'001001'b'010100' (-0.05413578804650284+0.07060343016684051j)
a'001001'b'100100' (-0.06916203876922586+0.066117638741352j)
a'001001'b'011000' (-0.08610035138400376+0.03573638174053081j)
a'001001'b'101000' (-0.09880990786413271+0.005566093591947395j)
a'001001'b'110000' (-0.02254440335454496+0.0002975232483466894j)
a'010001'b'000011' (-0.014817000769089358+0.027744997174266657j)
a'010001'b'000101' (0.10749049780043102+0.018903812918526303j)
a'010001'b'001001' (-0.05121501495873559-0.0028096969510876327j)
a'010001'b'010001' (-0.003315563971974618-0.028140271151387123j)
a'010001'b'100001' (-0.0682939464916194+0.013048562435597565j)
a'010001'b'000110' (0.11697516629024712+0.05836198595254573j)
a'010001'b'001010' (0.0026098876867509144+0.009903812423006392j)
a'010001'b'010010' (0.005735434792088916+0.01578503596874207j)
a'010001'b'100010' (-0.024661566374574825-0.015889669192177942j)
a'010001'b'001100' (-0.028093332392752378-0.03632393248999032j)
a'010001'b'010100' (0.0001485798271465555+0.07547839426854315j)
a'010001'b'100100' (0.042820455743816675+0.082291975056818j)
a'010001'b'011000' (-0.018932208432948332-0.022575039409745833j)
a'010001'b'101000' (-0.012918870079270407-0.011921639229832668j)
a'010001'b'110000' (-0.07162761451299024+0.015095636044023843j)
a'100001'b'000011' (0.024829235750333044-0.01854658673717294j)
a'100001'b'000101' (-0.0413615789740896-0.05130793754659329j)
a'100001'b'001001' (-0.029834188883838646+0.0029728050756063842j)
a'100001'b'010001' (-0.0580372981002739-0.038382873029924665j)
a'100001'b'100001' (-0.016025778797850873+0.016622346701739617j)
a'100001'b'000110' (0.02409970376528128-0.04658358158494602j)
a'100001'b'001010' (0.002014379451476635-0.027870690101504125j)
a'100001'b'010010' (-0.030700509202217844-0.002669648078288804j)
a'100001'b'100010' (-0.06523825798836044-0.026005492495919005j)
a'100001'b'001100' (0.03932936464647435-0.037429418525579065j)
a'100001'b'010100' (0.010533514859611261+0.06833788980681577j)
a'100001'b'100100' (-0.01830727914771641+0.03694680889091351j)
a'100001'b'011000' (-0.017353092889698808-0.009711816043853799j)
a'100001'b'101000' (-0.03558387205167898+0.0921392270465051j)
a'100001'b'110000' (0.008025813429095408-0.0569863123074657j)
a'000110'b'000011' (0.0004751754105534519-0.045211293239706164j)
a'000110'b'000101' (0.009741461250540255+0.029639388131812862j)
a'000110'b'001001' (-0.051335673434555945-0.07841847543336755j)
a'000110'b'010001' (0.04860498508167096+0.04514621805270708j)
a'000110'b'100001' (0.03595556787743489+0.012912372789917349j)
a'000110'b'000110' (-0.02535423099211783-0.02415327092506322j)
a'000110'b'001010' (-0.04736768814346257+0.0031329416067624703j)
a'000110'b'010010' (-0.025201573876768926+0.01578506609623759j)
a'000110'b'100010' (-0.06758268647895634+0.0265962108718416j)
a'000110'b'001100' (0.042296385927693754-0.03870406942263406j)
a'000110'b'010100' (-0.05704112881467965-0.014918750071457787j)
a'000110'b'100100' (-0.03556484262049246-0.03447908219620813j)
a'000110'b'011000' (0.008877636649426611+0.04641951514922745j)
a'000110'b'101000' (-0.07429981823045384+0.0390654967427915j)
a'000110'b'110000' (0.030277369366763902+0.05057400652185227j)
a'001010'b'000011' (-0.025651942885523353-0.11525232875193489j)
a'001010'b'000101' (-0.06443236565664401+0.02786891939198401j)
a'001010'b'001001' (0.004794288515894127+0.01716350272278589j)
a'001010'b'010001' (0.06623176339467254-0.007747272080316232j)
a'001010'b'100001' (0.0540272672743434-0.0666765987750745j)
a'001010'b'000110' (0.04920808617108029+0.0010278741128674808j)
a'001010'b'001010' (-0.009145488700532653-0.01771366156930951j)
a'001010'b'010010' (-0.03200443467465004+0.12137005681558269j)
a'001010'b'100010' (-0.015227311608269449-0.021929364312211597j)
a'001010'b'001100' (-0.0060874401774428264-0.012456937404160633j)
a'001010'b'010100' (-0.0773870731134327+0.02746457215596201j)
a'001010'b'100100' (-0.07002902303518468-0.06635952466848868j)
a'001010'b'011000' (0.04430561803075797+0.07625714051810704j)
a'001010'b'101000' (0.0009569992382241375+0.04104882368889234j)
a'001010'b'110000' (0.03444183732033715-0.0316083468734699j)
a'010010'b'000011' (-0.002881043098851678+3.284382404397353e-05j)
a'010010'b'000101' (0.05078720854640438+0.0293037291902411j)
a'010010'b'001001' (0.05159901239407642-0.10743980672194645j)
a'010010'b'010001' (-0.08753778364614195-0.08023621486391123j)
a'010010'b'100001' (-0.045590053760370466+0.15637369792843275j)
a'010010'b'000110' (0.00844379259056401+0.05373900432582383j)
a'010010'b'001010' (0.03256054527679392+0.05192888621319776j)
a'010010'b'010010' (0.03339297935349796+0.09851729009821913j)
a'010010'b'100010' (-0.0006703879816276379+0.01449883258740486j)
a'010010'b'001100' (-0.010972962645584497+0.004227827655881925j)
a'010010'b'010100' (-0.013733605956331671+0.02814524803217422j)
a'010010'b'100100' (-0.004848679139045579+0.046133490269424336j)
a'010010'b'011000' (0.03471692316277678+0.02775170271107091j)
a'010010'b'101000' (0.05256500707893294-0.050345289883642265j)
a'010010'b'110000' (-0.03295412987105108-0.058619123718340896j)
a'100010'b'000011' (-0.005049101152409233+0.03179805864984367j)
a'100010'b'000101' (0.015747564514521098+0.08372733412160546j)
a'100010'b'001001' (0.05412144479290246+0.022789741407809986j)
a'100010'b'010001' (0.014723172113178366+0.10238579030686591j)
a'100010'b'100001' (0.02849100388053949+0.0050111186446531505j)
a'100010'b'000110' (0.009580861261552429-0.00617651953397394j)
a'100010'b'001010' (-0.12009840592875272+0.09540513017418813j)
a'100010'b'010010' (0.03503729954849812+0.010241986881992644j)
a'100010'b'100010' (-0.03445166992330284+0.005640608286268837j)
a'100010'b'001100' (-0.016036538377323654-0.058124424709460984j)
a'100010'b'010100' (-0.03833169929857626+0.034773383338196545j)
a'100010'b'100100' (0.06830116944795447+0.028470900808484897j)
a'100010'b'011000' (0.02194644282960729+0.011622762737110576j)
a'100010'b'101000' (0.058738861698570406-0.043490718712943785j)
a'100010'b'110000' (0.012838141577415679+0.0009100251354491628j)
a'001100'b'000011' (0.04730502482364164-0.018635117552311783j)
a'001100'b'000101' (-0.058288171445879194+0.06589244949071468j)
a'001100'b'001001' (0.009005969789005183+0.020452575240974682j)
a'001100'b'010001' (-0.012038384278997996+0.050995877127178284j)
a'001100'b'100001' (-0.01813613331830318+0.04260677335492667j)
a'001100'b'000110' (0.04741162749132527-0.06934982786129065j)
a'001100'b'001010' (-0.003941456684534189+0.04324184917212323j)
a'001100'b'010010' (0.038881147832726816-0.0023098880920041677j)
a'001100'b'100010' (0.02635821440081466-0.08711469679611786j)
a'001100'b'001100' (0.04486434698864546+0.07463393779717487j)
a'001100'b'010100' (-0.0017818674894090193-0.013537293534917342j)
a'001100'b'100100' (0.007601036739415294+0.02660274597978181j)
a'001100'b'011000' (-0.008128899801490404-0.062157927881740904j)
a'001100'b'101000' (0.008591827950760647+0.04050886926623179j)
a'001100'b'110000' (0.007357393098136182+0.050950535667908685j)
a'010100'b'000011' (0.047643469142682526-0.010569499757901037j)
a'010100'b'000101' (-0.047346125927955125+0.01423329448621251j)
a'010100'b'001001' (-0.04940460999918479+0.05930896131389786j)
a'010100'b'010001' (0.06998791938656765+0.006147483845601657j)
a'010100'b'100001' (0.01970493423934991+0.05688979870241802j)
a'010100'b'000110' (-0.01209538443555915+0.03669124086307062j)
a'010100'b'001010' (-0.006623016574260173-0.045021716129459655j)
a'010100'b'010010' (0.02715812197480348-0.1063590822550598j)
a'010100'b'100010' (-0.018100748587858703+0.08030185466829218j)
a'010100'b'001100' (-0.031624745809271125+0.030647578353529496j)
a'010100'b'010100' (0.08922634069527646-0.014405338614315172j)
a'010100'b'100100' (-0.026130291860788198-0.010580537368595764j)
a'010100'b'011000' (0.11719817027794624+0.06519275673645776j)
a'010100'b'101000' (-0.04382896718617333-0.020383448427566363j)
a'010100'b'110000' (0.02583343731687252+0.0697407887501837j)
a'100100'b'000011' (0.004843513382047016-0.07950405964550386j)
a'100100'b'000101' (0.02243818582321648-0.004281108418896817j)
a'100100'b'001001' (-0.07308056765052519+0.05052376301032965j)
a'100100'b'010001' (-0.011601771218319838+0.05956822609580991j)
a'100100'b'100001' (0.026303280117521376-0.07070580109970323j)
a'100100'b'000110' (0.01993950713008856-0.008485793242906475j)
a'100100'b'001010' (0.09977448072857885+0.03382048499142165j)
a'100100'b'010010' (-0.035087459635174165+0.03811166257985926j)
a'100100'b'100010' (0.0704683852198618+0.053743851592101946j)
a'100100'b'001100' (-0.07521699288787602+0.033177083756643334j)
a'100100'b'010100' (-0.034050441821714024-0.014685907714886398j)
a'100100'b'100100' (0.052982287974486605-0.020412601085560374j)
a'100100'b'011000' (-0.018364973638407563+0.038830315248297234j)
a'100100'b'101000' (0.0003603266401285272-0.05613327581269889j)
a'100100'b'110000' (0.018065890331016785-0.00958183581760157j)
a'011000'b'000011' (0.02971248976569736-0.04655364688021493j)
a'011000'b'000101' (-0.014159068470351288+0.058826285484598215j)
a'011000'b'001001' (0.05509722783427735+0.0010215302239189345j)
a'011000'b'010001' (-0.009022467655745325+0.017685308398426088j)
a'011000'b'100001' (0.056295803260640924-0.06258240700014112j)
a'011000'b'000110' (-0.02189814547312707+0.01114783792571461j)
a'011000'b'001010' (-0.01854084314560579-0.032091865036685596j)
a'011000'b'010010' (-0.06088047268180541+0.06078182291964154j)
a'011000'b'100010' (-0.022951889995833714+0.06833926264410016j)
a'011000'b'001100' (-0.0744124814463674-0.034169065077453674j)
a'011000'b'010100' (0.0014401806427569-0.03843747279713977j)
a'011000'b'100100' (-0.0635407226540164+0.014831606332648462j)
a'011000'b'011000' (0.002996822985867058-0.0199868563610868j)
a'011000'b'101000' (0.003198762727470515-0.0781695193366614j)
a'011000'b'110000' (-0.03156273891059337+0.07196349614660591j)
a'101000'b'000011' (0.010885411021940976-0.024022935072313133j)
a'101000'b'000101' (0.01320794218075319-0.03444892594658442j)
a'101000'b'001001' (0.012842599018810925-0.05706595683169526j)
a'101000'b'010001' (-0.01550721936204072-0.06085672627673226j)
a'101000'b'100001' (0.008754530408015698-0.017801504579174447j)
a'101000'b'000110' (0.013552932496428766-0.01096077637251328j)
a'101000'b'001010' (-0.016607667078916023-0.00013038430359926757j)
a'101000'b'010010' (0.06006738816961667-0.06196073114379453j)
a'101000'b'100010' (-0.10766335518992864-0.02090044383683544j)
a'101000'b'001100' (0.019326267034677196-0.1039584904289375j)
a'101000'b'010100' (-0.01153670500053897-0.009169466889927312j)
a'101000'b'100100' (-0.03727396769088689+0.006512487569759672j)
a'101000'b'011000' (-0.04062606904854714-0.025430673552504064j)
a'101000'b'101000' (0.06645293715753277+0.025488329381583914j)
a'101000'b'110000' (0.0068585131781931825+0.011396942152858023j)
a'110000'b'000011' (0.08239806055410813-0.004502992570921334j)
a'110000'b'000101' (-0.0455639811274113+0.00884681716806573j)
a'110000'b'001001' (-0.09359026539966228+0.0007158920487926167j)
a'110000'b'010001' (0.05195858686832057+0.08613740381691128j)
a'110000'b'100001' (-0.01096952170068222-0.06480944056039672j)
a'110000'b'000110' (-0.07802404236319821-0.05285244693550424j)
a'110000'b'001010' (-0.005169811580703318-0.039578304731752015j)
a'110000'b'010010' (0.07395784981427667+0.10092110051676145j)
a'110000'b'100010' (-0.04806654362859742-0.023773192394143165j)
a'110000'b'001100' (-0.06465385725903645+0.02044849101681175j)
a'110000'b'010100' (0.06905312772293788-0.021396977919963863j)
a'110000'b'100100' (-0.06685534428563097-0.053075567081591564j)
a'110000'b'011000' (-0.019238525638727248+0.0660888966849829j)
a'110000'b'101000' (0.016797713262624338-0.038665382018335505j)
a'110000'b'110000' (-0.03739157191161516+0.01550357612360522j)
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): inital_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