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.939601349029983+0.3422708063814909j)

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.03493839943651068-0.016706419245428258j)
a'000011'b'000101' (0.029858241040196597+0.017054702716852162j)
a'000011'b'001001' (0.1553185223892146-0.02503982275399338j)
a'000011'b'010001' (-0.016705314562336853-0.008488676464130901j)
a'000011'b'100001' (-0.04189922181746475-0.025882909194075182j)
a'000011'b'000110' (0.015417772460832984+0.10710247938972879j)
a'000011'b'001010' (-0.03913411319719654+0.042741433739459656j)
a'000011'b'010010' (0.004564837052606459+0.05093174112518984j)
a'000011'b'100010' (0.006658356032626023+0.019367555828517808j)
a'000011'b'001100' (0.004775499345918255-0.08558895666611742j)
a'000011'b'010100' (0.010066727838787636-0.021385448308912938j)
a'000011'b'100100' (-0.015225113499523662+0.0777720012759777j)
a'000011'b'011000' (0.04632022928217101+0.036881789840984495j)
a'000011'b'101000' (0.03250299997824818+0.021029963847877694j)
a'000011'b'110000' (-0.008232143771981946-0.06719491588222502j)
a'000101'b'000011' (0.024968329344231842-0.05303648594359706j)
a'000101'b'000101' (0.034219467817050285+0.03996832871556209j)
a'000101'b'001001' (-0.009073022714752209+0.045721833909991336j)
a'000101'b'010001' (-0.041229218968452344-0.009728114907269455j)
a'000101'b'100001' (0.029507944050650742-0.0044684067748356855j)
a'000101'b'000110' (0.011185139815016443-0.02310795200469005j)
a'000101'b'001010' (-0.010134088707704662+0.011307929312390285j)
a'000101'b'010010' (-0.01779363991904935-0.006348065389540215j)
a'000101'b'100010' (0.010044100459543508+0.039602835993872765j)
a'000101'b'001100' (-0.10400660850797312+0.04321019556187638j)
a'000101'b'010100' (0.004484808625413988+0.00604566628607972j)
a'000101'b'100100' (-0.047706157538354235-0.025123729338358634j)
a'000101'b'011000' (0.04605473914083122-0.08931477189775047j)
a'000101'b'101000' (0.015340413056253038+0.03257125214628433j)
a'000101'b'110000' (0.00958266741841302+0.08768354657989615j)
a'001001'b'000011' (-0.0644092068698931-0.021601755818924047j)
a'001001'b'000101' (0.04308915262928837-0.097297053649804j)
a'001001'b'001001' (-0.016408768718395188+0.012096436485681171j)
a'001001'b'010001' (-0.021439021783816438-0.061831102824796015j)
a'001001'b'100001' (-0.028332915354730318+0.011891066344144628j)
a'001001'b'000110' (0.005535950528955921-0.12551922880471858j)
a'001001'b'001010' (0.047148637345486154-0.14261558974971908j)
a'001001'b'010010' (0.05855689028440551+0.03158574339746127j)
a'001001'b'100010' (-0.023695434635801312-0.015797030038058532j)
a'001001'b'001100' (0.0011773251266899746-0.054417232982812196j)
a'001001'b'010100' (0.0017844478746843317-0.0013096645265031968j)
a'001001'b'100100' (-0.030361905748546802+0.06302081072325807j)
a'001001'b'011000' (-0.0364102255934104-0.06384359642017536j)
a'001001'b'101000' (0.07518010332277701+0.009783196493090366j)
a'001001'b'110000' (-0.010655750726845284+0.017401387944842812j)
a'010001'b'000011' (-0.030390964984072788-0.05967899141887502j)
a'010001'b'000101' (0.02893654229364903-0.003729451530018133j)
a'010001'b'001001' (0.03248723601278135-0.01970606058135254j)
a'010001'b'010001' (-0.003544382155330499+0.03117046472804281j)
a'010001'b'100001' (-0.07700448113849168+0.056598825597335554j)
a'010001'b'000110' (-0.036076287679713784+0.06209632254694214j)
a'010001'b'001010' (0.014254012302012595+0.027432414660933244j)
a'010001'b'010010' (-0.05298253473945426+0.07132503922924169j)
a'010001'b'100010' (0.0087788432855471+0.05185999805516959j)
a'010001'b'001100' (-0.05602414649548848+0.024180685162384048j)
a'010001'b'010100' (-0.06617845785375993+0.015730209939163967j)
a'010001'b'100100' (0.06915122426916948-0.000744174155643213j)
a'010001'b'011000' (0.03521431418514866-0.05623767363742101j)
a'010001'b'101000' (-0.05803744044155475+0.005318640028329106j)
a'010001'b'110000' (-0.08169096240204458-0.01969508944513965j)
a'100001'b'000011' (-0.008597887442990969+0.01857644138221281j)
a'100001'b'000101' (0.07770412579400943+0.015564983756968733j)
a'100001'b'001001' (0.033410120351150985+0.028079020506042482j)
a'100001'b'010001' (0.004385763782722287-0.0011235654110909846j)
a'100001'b'100001' (-0.027588624863058193-0.007997218787197589j)
a'100001'b'000110' (-0.10817685287942415-0.0685140300631846j)
a'100001'b'001010' (0.02805277926207675+0.003688254284408851j)
a'100001'b'010010' (0.04983560590510247+0.0028826017634540823j)
a'100001'b'100010' (-0.03277094303635912-0.04871484343054851j)
a'100001'b'001100' (0.014259965352794826+0.024808759389647106j)
a'100001'b'010100' (-0.05489614686523071-0.02135539832534212j)
a'100001'b'100100' (-0.04258616029530807-0.0415750678185557j)
a'100001'b'011000' (0.016014295583468476-0.042970673987372185j)
a'100001'b'101000' (-0.08210135093054423+0.08343697342223648j)
a'100001'b'110000' (-0.0415563465433224-0.0016420374529165175j)
a'000110'b'000011' (0.04052966719092628+0.00584215929627159j)
a'000110'b'000101' (-0.01507838876181602+0.0033853531215643543j)
a'000110'b'001001' (0.04915438528458022+0.06781048799212962j)
a'000110'b'010001' (0.0409940309484065+0.12934171249165716j)
a'000110'b'100001' (0.025123785825775992-0.04145164419481545j)
a'000110'b'000110' (0.026189446537778948+0.09181412561509389j)
a'000110'b'001010' (-0.08072580049120434+0.01656602568165777j)
a'000110'b'010010' (0.02553585779008319-0.0066416437285231715j)
a'000110'b'100010' (0.011318429225534565-0.01807222758418658j)
a'000110'b'001100' (0.04244966481940084+0.037543953612391066j)
a'000110'b'010100' (-0.10517204126820405+0.04284783526554023j)
a'000110'b'100100' (-0.009468479586701037-0.008687175756313512j)
a'000110'b'011000' (0.01305127678978064+0.03092105759766594j)
a'000110'b'101000' (0.024594091316292973-0.014277546890510837j)
a'000110'b'110000' (0.04597580126889745+0.08351563944883955j)
a'001010'b'000011' (-0.01173213397632679-0.06993404947257671j)
a'001010'b'000101' (-0.05243234194882959-0.02243299038301989j)
a'001010'b'001001' (-0.0729745781059409+0.009194180162714727j)
a'001010'b'010001' (-0.06877605895804868-0.008197743779337224j)
a'001010'b'100001' (0.05895321139504197+0.0391800437783482j)
a'001010'b'000110' (-0.05875726108879755+0.014011705917197663j)
a'001010'b'001010' (-0.009543711221828226+0.02290222628467341j)
a'001010'b'010010' (0.022383890708123952+0.12876956282986932j)
a'001010'b'100010' (0.050897595618043856-0.04828440875533768j)
a'001010'b'001100' (-0.008985119894214723+0.038638169315093514j)
a'001010'b'010100' (-0.0765013070173362-0.010256641498916724j)
a'001010'b'100100' (0.06243300905674258-0.007048310914839753j)
a'001010'b'011000' (-0.02332260426982489+0.036657409351959255j)
a'001010'b'101000' (0.024904935544376155-0.003040045198607388j)
a'001010'b'110000' (0.04327899710417858-0.08739782093776656j)
a'010010'b'000011' (0.02391304745381837-0.019627699644843448j)
a'010010'b'000101' (-0.042414363953174085-0.002319976905919654j)
a'010010'b'001001' (-0.0017746996211660576+0.013674651577822255j)
a'010010'b'010001' (-0.007635078761079466+0.03861603469856819j)
a'010010'b'100001' (-0.05526395683543499-0.06868709812176277j)
a'010010'b'000110' (-0.11540570830439159+0.0030714440531671343j)
a'010010'b'001010' (0.013842664567361745+9.565075067918055e-05j)
a'010010'b'010010' (-0.023414937934446618-0.00580359103552389j)
a'010010'b'100010' (-0.024194368862822953-0.0007883968676264515j)
a'010010'b'001100' (-0.012110523502408935-0.03647664039216999j)
a'010010'b'010100' (-0.0018001632953299227+0.0005185307777686647j)
a'010010'b'100100' (0.03074057985082502+0.03865262655159507j)
a'010010'b'011000' (-0.0013459536763281688+0.017524148029182403j)
a'010010'b'101000' (-0.04883598048965433-0.02505826593596369j)
a'010010'b'110000' (0.029647177901192596+0.004146627422675372j)
a'100010'b'000011' (0.10442892066422862+0.00806861452711512j)
a'100010'b'000101' (-0.01290670216641695-0.03189483326787399j)
a'100010'b'001001' (-0.07221673845206154+0.017096970421563388j)
a'100010'b'010001' (0.02974626649391757-0.036186807938535646j)
a'100010'b'100001' (-0.07078690757208499+0.041982322487462434j)
a'100010'b'000110' (0.06400328279420357+0.039857583858318044j)
a'100010'b'001010' (-0.027642636215012846-0.07758008717390863j)
a'100010'b'010010' (-0.026436682116268727-0.038415721588719455j)
a'100010'b'100010' (-0.09895631058020939-0.0020692855088561626j)
a'100010'b'001100' (-0.06764418755881758-0.036299276589882086j)
a'100010'b'010100' (0.0028488117291575908+0.03759846557234472j)
a'100010'b'100100' (0.01861832471066292+0.027548234977265804j)
a'100010'b'011000' (-0.021133703633961082+0.016151452624956913j)
a'100010'b'101000' (0.055491022547738994+0.016936178215714703j)
a'100010'b'110000' (-0.009097381872727718-0.060341704970320126j)
a'001100'b'000011' (0.03667103207739797-0.03656136154160943j)
a'001100'b'000101' (0.05812317283996254-0.09838156016077987j)
a'001100'b'001001' (-0.007553441645401211-0.07844915590985299j)
a'001100'b'010001' (0.12036334290431094+0.06308456181182379j)
a'001100'b'100001' (-0.0028837985673470295-0.05042351104502555j)
a'001100'b'000110' (0.026998911560296678-0.02442423747719331j)
a'001100'b'001010' (-0.06727401911414192-0.002144982237462774j)
a'001100'b'010010' (0.06568967240482068+0.01181118224046792j)
a'001100'b'100010' (0.05932852881552439-0.04284263391431584j)
a'001100'b'001100' (0.029797402051404475+0.09952097962798354j)
a'001100'b'010100' (0.037586028522612884+0.017948296037940705j)
a'001100'b'100100' (0.004283359494557074-0.023583095338640996j)
a'001100'b'011000' (0.029121905384343564-0.040792537668703215j)
a'001100'b'101000' (0.02125277500778012+0.04139323138554245j)
a'001100'b'110000' (0.035182104469702165-0.04972379331564732j)
a'010100'b'000011' (-0.08018715276728854-0.026779688284244464j)
a'010100'b'000101' (-0.005128021441920076+0.01876429949855531j)
a'010100'b'001001' (-0.05496419573038188-0.004916289616508326j)
a'010100'b'010001' (-0.007624109583222524+0.030661948317425677j)
a'010100'b'100001' (-0.025374563922449998+0.04543140403461899j)
a'010100'b'000110' (0.014380410312559985+0.013750196009009041j)
a'010100'b'001010' (0.008677774721517472-0.049622962798967454j)
a'010100'b'010010' (0.009943568875197201-0.008043493854201037j)
a'010100'b'100010' (0.005273477451735918-0.0141252729859694j)
a'010100'b'001100' (0.00024045800332611866+0.0019701411051512374j)
a'010100'b'010100' (0.025549219892221836-0.057229281363651546j)
a'010100'b'100100' (-0.019424930032288432+0.013111295583912174j)
a'010100'b'011000' (0.03245483098208731-0.02731124696594675j)
a'010100'b'101000' (0.06314610432655586+0.019830288330017647j)
a'010100'b'110000' (-0.0010953268110962195-0.030915449378706782j)
a'100100'b'000011' (-0.018014239044322575+0.0449885940800577j)
a'100100'b'000101' (-0.020908335191964056-0.09937040270656379j)
a'100100'b'001001' (-0.022131274537347576+0.0599080943346368j)
a'100100'b'010001' (0.05704207681475996-0.0352600533537316j)
a'100100'b'100001' (0.00569089472742174+0.001976372044387406j)
a'100100'b'000110' (-0.016597198822882752-0.05115076866616738j)
a'100100'b'001010' (-0.015033481001990564+0.006146490681259063j)
a'100100'b'010010' (0.0005605928110656299+0.05948735295347145j)
a'100100'b'100010' (0.07931532275474346+0.05394728553363505j)
a'100100'b'001100' (0.027215712604813695-0.03264830759573007j)
a'100100'b'010100' (0.04338965847453713+0.03258866936534439j)
a'100100'b'100100' (-0.0034947069913125123-0.014967086630706103j)
a'100100'b'011000' (-0.04409902408493329+0.033624952875189906j)
a'100100'b'101000' (0.006883659011123038-0.016226311809650742j)
a'100100'b'110000' (0.05460823235939543-0.019435156487431066j)
a'011000'b'000011' (0.02581900286998013+0.01138250931617517j)
a'011000'b'000101' (0.031694436020913264-0.009864500008702858j)
a'011000'b'001001' (-0.08985506750580405-0.09128441317212527j)
a'011000'b'010001' (-0.05857243013184669+0.03964015779384838j)
a'011000'b'100001' (-0.06040111199929313+0.014098320850268993j)
a'011000'b'000110' (-0.0649238866784874+0.06470156201065631j)
a'011000'b'001010' (-0.1256212331825667+0.041829495267221566j)
a'011000'b'010010' (0.01259364127909673+0.01741491089902318j)
a'011000'b'100010' (0.12339453193409985+0.095012952255862j)
a'011000'b'001100' (-0.04796907994270126-0.02008463863523602j)
a'011000'b'010100' (-0.052172155179660194+0.015184312926972091j)
a'011000'b'100100' (0.06982054481073074+0.035550044356615226j)
a'011000'b'011000' (0.0038513773798171014+0.0038520403447208675j)
a'011000'b'101000' (-0.0046810803516304025-0.022823940479860725j)
a'011000'b'110000' (0.04189054488360067+0.02180210730857338j)
a'101000'b'000011' (-0.017670507331435527-0.009679922531995056j)
a'101000'b'000101' (-0.08667994493678165+0.014130361438576303j)
a'101000'b'001001' (-0.16344487424265539-0.00044099412911283376j)
a'101000'b'010001' (-0.04139609752673184+0.02644476956468419j)
a'101000'b'100001' (-0.014100054728480573-0.0020349245154376184j)
a'101000'b'000110' (0.004561452466144489-0.07729517750502733j)
a'101000'b'001010' (-0.04708783786254815-0.023694754400723477j)
a'101000'b'010010' (0.005800696658828829-0.016198884071715436j)
a'101000'b'100010' (-0.08544197399447867-0.012249637513183762j)
a'101000'b'001100' (0.009165658170714722+0.11415616551487597j)
a'101000'b'010100' (-0.03121175552675283-0.018403922545217253j)
a'101000'b'100100' (0.002859843038533094+0.019018514360907124j)
a'101000'b'011000' (0.008547412782776204-0.09633862878072273j)
a'101000'b'101000' (0.024491992990821086+0.07872794065935192j)
a'101000'b'110000' (0.03499721690828932+0.09631373866785452j)
a'110000'b'000011' (-0.004257152532430403-0.007824841687155295j)
a'110000'b'000101' (0.10084156468939157+0.04054189218345433j)
a'110000'b'001001' (0.025260619170394148+0.04238035506195924j)
a'110000'b'010001' (0.06332597808882229+0.018756821440579687j)
a'110000'b'100001' (-0.05524168616066243+0.019615847867335553j)
a'110000'b'000110' (0.01593368638099005+0.010321497797360937j)
a'110000'b'001010' (0.03668971815904667+0.02628374188732158j)
a'110000'b'010010' (0.047234431413341764+0.033791547425666466j)
a'110000'b'100010' (-0.06627221023073918-0.0062220317660705024j)
a'110000'b'001100' (0.05670778378595443-0.036179226024092154j)
a'110000'b'010100' (0.04508992860469286+0.12130845512888311j)
a'110000'b'100100' (-0.01435124218012372+0.05781885307363308j)
a'110000'b'011000' (0.06483061681209097-0.034471977611192334j)
a'110000'b'101000' (0.0638252805118735-0.016344280844822666j)
a'110000'b'110000' (-0.041100583001072194-0.10278436295569919j)

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.03276137361582899-0.020651600373657496j)
a'000011'b'000101' (0.0340219965881272+0.0049881049439789195j)
a'000011'b'001001' (-0.1569538585255602-0.010785286953011454j)
a'000011'b'010001' (-0.013526196275027725+0.012967928788697907j)
a'000011'b'100001' (0.014555255701389928+0.04704906278264226j)
a'000011'b'000110' (0.10497159656468676+0.026260478170474062j)
a'000011'b'001010' (-0.05794383700979449-0.0009059395222540672j)
a'000011'b'010010' (-0.037364167251974584-0.03491130185092891j)
a'000011'b'100010' (-0.012509218311550116-0.016215899021082385j)
a'000011'b'001100' (-0.03548730197534464-0.07803157242878098j)
a'000011'b'010100' (0.022936057792034056-0.005710837216545679j)
a'000011'b'100100' (0.0757636662056759-0.023241238061234612j)
a'000011'b'011000' (0.046879907976405476-0.03616772443424105j)
a'000011'b'101000' (0.009420654007763032+0.0375493763609339j)
a'000011'b'110000' (0.05312760381441149-0.04195691390510994j)
a'000101'b'000011' (0.0039016651290579123-0.05848985656255358j)
a'000101'b'000101' (0.015068564012470252+0.05041207847926379j)
a'000101'b'001001' (-0.023847352169524064-0.04005133745304816j)
a'000101'b'010001' (0.02358831250510511+0.03518630741579928j)
a'000101'b'100001' (0.020739735412871715-0.021460400653431595j)
a'000101'b'000110' (-0.007761451097978483-0.024471303099471726j)
a'000101'b'001010' (-0.003729436237134554+0.014719386013784351j)
a'000101'b'010010' (-0.006323414523563072-0.017802415131713354j)
a'000101'b'100010' (0.03018923939742122-0.027529591304706606j)
a'000101'b'001100' (-0.05173208138926948-0.10004142826329698j)
a'000101'b'010100' (-0.00677674739941673-0.0032770846699051357j)
a'000101'b'100100' (0.05391097372968608-0.0008283444081263444j)
a'000101'b'011000' (-0.07437135211977482-0.06758009662876843j)
a'000101'b'101000' (0.004304011298266841-0.03574479298943668j)
a'000101'b'110000' (0.044397260209608574-0.07621755140098006j)
a'001001'b'000011' (0.05784369008255518+0.035627086629451056j)
a'001001'b'000101' (0.03307296450399745+0.10114134042101809j)
a'001001'b'001001' (0.011655189524798514-0.016725071708274673j)
a'001001'b'010001' (0.005617431227264544+0.06520093095949174j)
a'001001'b'100001' (0.02899858478325198+0.010160395261391597j)
a'001001'b'000110' (-0.05334329681977471-0.11375507123811124j)
a'001001'b'001010' (-0.14948848631405298-0.014676270055076988j)
a'001001'b'010010' (0.04466060867832348-0.04931529801422508j)
a'001001'b'100010' (-0.006550191248111552-0.027714883640672545j)
a'001001'b'001100' (-0.05442144190568686-0.0009633280155531532j)
a'001001'b'010100' (-0.000803792379913186-0.002062375620356236j)
a'001001'b'100100' (0.05919991356799432-0.037267118730086465j)
a'001001'b'011000' (-0.06543979883845825-0.03345656975255216j)
a'001001'b'101000' (-0.0747910073830946-0.012412255390046213j)
a'001001'b'110000' (-0.004966819213443971-0.019791008889406023j)
a'010001'b'000011' (-0.06636505210791593+0.008992921002149653j)
a'010001'b'000101' (-0.023739961470179177-0.01696014498821582j)
a'010001'b'001001' (-0.03632845466990867+0.011135201331026095j)
a'010001'b'010001' (0.03004926262300592-0.009011233657985236j)
a'010001'b'100001' (0.08449449358995674+0.044651962189613724j)
a'010001'b'000110' (-0.07092455849278932+0.011276471487404727j)
a'010001'b'001010' (0.030043401842222782-0.007287540502943128j)
a'010001'b'010010' (-0.010254046782766176+0.08825681125582993j)
a'010001'b'100010' (-0.03974248138679271+0.034453775713770826j)
a'010001'b'001100' (0.008874273699007208+0.06037100124882312j)
a'010001'b'010100' (-0.04047227373478792+0.05467195668135948j)
a'010001'b'100100' (-0.056060014786434374-0.040493460647907806j)
a'010001'b'011000' (-0.02074975681325032-0.06302516522683946j)
a'010001'b'101000' (0.03683075125884518-0.04516777818829518j)
a'010001'b'110000' (0.04214013703185042-0.07270157314227241j)
a'100001'b'000011' (0.0186913987705608-0.008345025758438915j)
a'100001'b'000101' (0.07120286533694857-0.03479011141940063j)
a'100001'b'001001' (-0.005982263934361453-0.04323054536640483j)
a'100001'b'010001' (-0.002922150278715858-0.0034580863117394j)
a'100001'b'100001' (0.028505310365178265+0.0035404817680253125j)
a'100001'b'000110' (-0.009417760821526115+0.12770164288490607j)
a'100001'b'001010' (0.017996391039347807+0.02183326712959254j)
a'100001'b'010010' (0.02343896872274798+0.04407393508718499j)
a'100001'b'100010' (0.039900825432972034-0.04306965065707687j)
a'100001'b'001100' (0.0010961261154103258-0.028594049413390683j)
a'100001'b'010100' (0.03146245217866716+0.04979712924645442j)
a'100001'b'100100' (-0.0033863490009966688-0.05941885183389719j)
a'100001'b'011000' (0.01947460806292157+0.041517178694599595j)
a'100001'b'101000' (0.10769704904215821+0.045866174748875034j)
a'100001'b'110000' (0.04062182687284475+0.008915907499414358j)
a'000110'b'000011' (0.020745601284637396-0.035304458290548964j)
a'000110'b'000101' (-0.008623723329230438+0.012823798943801014j)
a'000110'b'001001' (0.07500881931930843+0.037257118766204335j)
a'000110'b'010001' (-0.07434419007834564+0.11350211700787004j)
a'000110'b'100001' (-0.04840060289635889-0.0026124815677850462j)
a'000110'b'000110' (0.07298744691709011-0.061551225535681944j)
a'000110'b'001010' (0.07253001298597513-0.03912141725558208j)
a'000110'b'010010' (-0.019999553350224655-0.017210732996694275j)
a'000110'b'100010' (-0.0036014515298885058+0.021017654409232565j)
a'000110'b'001100' (0.02539929170528983-0.050659633605055286j)
a'000110'b'010100' (-0.04566289003607025+0.10398074689584337j)
a'000110'b'100100' (-0.0002927814504715837-0.01284653289129465j)
a'000110'b'011000' (0.01813339496013119+0.028242301889568604j)
a'000110'b'101000' (0.02645181054359718-0.010441235168816692j)
a'000110'b'110000' (0.03615380304962788+0.08821303112304006j)
a'001010'b'000011' (0.04452507435282659-0.05518996282972616j)
a'001010'b'000101' (-0.05685507413591413+0.004459830127187221j)
a'001010'b'001001' (0.024996395247349302+0.06917371049208518j)
a'001010'b'010001' (-0.02439125504047655+0.06482604388996045j)
a'001010'b'100001' (0.016380005442224947+0.06886401372251306j)
a'001010'b'000110' (0.052228914524893824-0.030346072578152392j)
a'001010'b'001010' (-0.005386284406556793+0.02421946186379291j)
a'001010'b'010010' (-0.000323627612033501+0.13070016885910143j)
a'001010'b'100010' (-0.07006146840110888+0.003652398394325092j)
a'001010'b'001100' (0.0038125092556048927+0.03948550722367859j)
a'001010'b'010100' (-0.07712978482230536+0.0029402318723038287j)
a'001010'b'100100' (0.06278517801993365+0.0023623563737913975j)
a'001010'b'011000' (0.024209470356857804+0.03607784743252274j)
a'001010'b'101000' (-0.01500887371091023-0.020105506688692383j)
a'001010'b'110000' (-0.05249093990030316+0.08219581451263905j)
a'010010'b'000011' (-0.004732256736892396+0.03057263773462954j)
a'010010'b'000101' (-0.025002923472201292-0.034339691032965906j)
a'010010'b'001001' (0.01285469322066574+0.0049902421507151285j)
a'010010'b'010001' (0.012682189151114376+0.03726465673884931j)
a'010010'b'100001' (0.02995801517284908-0.08291284400140207j)
a'010010'b'000110' (0.068234771359363+0.09312318323245565j)
a'010010'b'001010' (0.013615622743359066+0.002498665383984257j)
a'010010'b'010010' (-0.010687936130677082-0.02162658106701491j)
a'010010'b'100010' (0.015028305434293005+0.018977330952081196j)
a'010010'b'001100' (-0.018153878547420947-0.033876935627172304j)
a'010010'b'010100' (-0.0018714430881003664-8.463347651978644e-05j)
a'010010'b'100100' (0.026133068224090245+0.04190550720486586j)
a'010010'b'011000' (0.017519391088993086+0.0014065174433432073j)
a'010010'b'101000' (0.045834446586975726+0.03020054946799887j)
a'010010'b'110000' (-0.028107322877012023+0.010301848240720817j)
a'100010'b'000011' (-0.10151441059054346+0.025793922810179278j)
a'100010'b'000101' (-0.022042071059007778+0.02641988746054241j)
a'100010'b'001001' (-0.06446812221893539-0.036761731839151525j)
a'100010'b'010001' (0.04637561396233314+0.006605139568872249j)
a'100010'b'100001' (-0.057097476885236795-0.059272082959855955j)
a'100010'b'000110' (-0.07434834964322848-0.012544724181340087j)
a'100010'b'001010' (-0.029373407439583405+0.076941459553449j)
a'100010'b'010010' (-0.012244742496944136+0.044997023320239506j)
a'100010'b'100010' (-0.09319961176135622+0.03332365096589044j)
a'100010'b'001100' (-0.06145891117637857-0.046001911139160995j)
a'100010'b'010100' (-0.0014566208432853398+0.037678091742840196j)
a'100010'b'100100' (0.031199824943633984-0.011494267653092416j)
a'100010'b'011000' (0.022758823158214612-0.01376730981845916j)
a'100010'b'101000' (0.03836517817387881+0.04352241743785218j)
a'100010'b'110000' (-0.04065673866982125-0.045507288607400595j)
a'001100'b'000011' (0.015517276936746528-0.04940356128728114j)
a'001100'b'000101' (0.10288542779214385+0.04971743505734047j)
a'001100'b'001001' (-0.07841884652872286+0.007861873362215568j)
a'001100'b'010001' (0.0920581269694615-0.09996148014592961j)
a'001100'b'100001' (-0.02434078062100743+0.0442535101324724j)
a'001100'b'000110' (-0.030532428820675965-0.019830667968916558j)
a'001100'b'001010' (-0.06444222746262494+0.019431775941078443j)
a'001100'b'010010' (0.06674164775218201+0.0004353640934502377j)
a'001100'b'100010' (0.06506553687726804-0.03349390277354178j)
a'001100'b'001100' (-0.05938414335326682-0.08523986199733799j)
a'001100'b'010100' (-0.04150443037138626-0.0034975892147274326j)
a'001100'b'100100' (-0.001708559990936041-0.023907956354912812j)
a'001100'b'011000' (0.030789066668630873-0.039549334714276j)
a'001100'b'101000' (-0.04652959278020206+0.0002775712105909042j)
a'001100'b'110000' (0.06081776534822625-0.0033816437811132133j)
a'010100'b'000011' (-0.029913249841309875-0.07907166785554195j)
a'010100'b'000101' (-0.004156842097655061-0.01900305773699164j)
a'010100'b'001001' (-0.01895940885420441+0.05182444917006098j)
a'010100'b'010001' (0.01392698072255434+0.028360559400531372j)
a'010100'b'100001' (0.04740544340445051-0.02146170781738337j)
a'010100'b'000110' (0.019895827924415663-0.00014185290195082944j)
a'010100'b'001010' (8.789404703010143e-05-0.05037593161125275j)
a'010100'b'010010' (0.011994265224936717-0.004439589741432664j)
a'010100'b'100010' (0.006849605960824088-0.013431894860501515j)
a'010100'b'001100' (-0.0009215980725758818-0.0017578205307125481j)
a'010100'b'010100' (-0.02197578536158065+0.0586942768951355j)
a'010100'b'100100' (-0.011092877549309764+0.0206441770561104j)
a'010100'b'011000' (0.012771465443592773-0.040448855797586j)
a'010100'b'101000' (0.023751083839260962+0.061778287798645797j)
a'010100'b'110000' (0.0021028780715199136-0.03086328976189687j)
a'100100'b'000011' (0.04816775095664033-0.005324863700159344j)
a'100100'b'000101' (0.06599657255715753+0.07717569452406647j)
a'100100'b'001001' (0.05057303019052094-0.039001816583383j)
a'100100'b'010001' (-0.06683122179270698-0.0055369381017836465j)
a'100100'b'100001' (0.0028673508872835676+0.005298172151376997j)
a'100100'b'000110' (0.02539665945834694-0.04740124294006255j)
a'100100'b'001010' (-0.015783291979619706+0.0038304820869034454j)
a'100100'b'010010' (-0.0062256177657024755+0.059163342613024125j)
a'100100'b'100010' (0.07134118108109222-0.06412227321369295j)
a'100100'b'001100' (0.018253463658784632-0.03838512818671642j)
a'100100'b'010100' (0.05357019424235327+0.008655525540211081j)
a'100100'b'100100' (0.010738140333403708-0.010996317626656586j)
a'100100'b'011000' (-0.053758877664864854-0.01361412697591601j)
a'100100'b'101000' (0.017613636196442076-0.0006616466313767261j)
a'100100'b'110000' (0.049754411105398924-0.029736895007105395j)
a'011000'b'000011' (0.01722117680594293-0.022352035633277575j)
a'011000'b'000101' (-0.0013349435640942554-0.03316720610461705j)
a'011000'b'001001' (-0.12518335932106006-0.027127546769773473j)
a'011000'b'010001' (-0.006943781924368848+0.07038363143556939j)
a'011000'b'100001' (0.03221586277085101-0.053001841170642154j)
a'011000'b'000110' (-0.05293851053848498+0.0748259132254769j)
a'011000'b'001010' (-0.01212526179729904+0.13184604251537585j)
a'011000'b'010010' (0.01745833649487533-0.012533371817639102j)
a'011000'b'100010' (-0.11237712982340294-0.10781953580063472j)
a'011000'b'001100' (-0.04709459955776188-0.02205728977348163j)
a'011000'b'010100' (-0.03591731353742538+0.04077307596207375j)
a'011000'b'100100' (0.015594150103128646+0.07678239781346805j)
a'011000'b'011000' (0.0015989982691125956+0.005207161133909634j)
a'011000'b'101000' (0.011080696320397869-0.020495437085892236j)
a'011000'b'110000' (0.04086578955166352-0.023667211032537404j)
a'101000'b'000011' (-0.006317555025899523-0.019132073282069405j)
a'101000'b'000101' (0.08094601747554842+0.034070841249909174j)
a'101000'b'001001' (0.16332898971130147+0.006169482304450157j)
a'101000'b'010001' (0.010094917831534116-0.04807343717424953j)
a'101000'b'100001' (0.0032669700953905914+0.013866483603477128j)
a'101000'b'000110' (0.016063069933809085-0.07574515891089105j)
a'101000'b'001010' (0.0028235046742164584+0.052637759090171245j)
a'101000'b'010010' (-0.007521165123080811+0.0154752706628342j)
a'101000'b'100010' (-0.06632451296777027-0.05523987254570415j)
a'101000'b'001100' (-0.10599969192037663-0.043355561667995805j)
a'101000'b'010100' (-0.005004090231911813-0.03588644770749852j)
a'101000'b'100100' (-0.01600211574536564+0.010668405802789733j)
a'101000'b'011000' (0.06845852784841026-0.06831997969450447j)
a'101000'b'101000' (0.048272469052605106+0.06684096866959775j)
a'101000'b'110000' (0.023727840810789623-0.09969017513257489j)
a'110000'b'000011' (0.0044723260034360635-0.00770388182881926j)
a'110000'b'000101' (-0.05701473770084689-0.09253099953919879j)
a'110000'b'001001' (-0.04794733684550274-0.011629542788661785j)
a'110000'b'010001' (-0.03601154775737247+0.05536394385860054j)
a'110000'b'100001' (0.05782835601984123-0.009607633291818993j)
a'110000'b'000110' (0.014652956388058833+0.012070896717241859j)
a'110000'b'001010' (-0.03362690795335981-0.030103182019279782j)
a'110000'b'010010' (-0.05758177724579805-0.007569618060248833j)
a'110000'b'100010' (-0.05885880225142068+0.03108634629050887j)
a'110000'b'001100' (0.06360178932301026+0.02189798010156006j)
a'110000'b'010100' (0.032322501909227336+0.12531599585711523j)
a'110000'b'100100' (-0.0027697071230062217+0.05950887870995132j)
a'110000'b'011000' (0.0056681484652674-0.07320654485521363j)
a'110000'b'101000' (-0.062297474899067506-0.021443567099571594j)
a'110000'b'110000' (0.1099109436418581-0.013170712167275308j)
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.03276137361582898-0.020651600373657483j)
a'000011'b'000101' (0.034021996588127185+0.004988104943978923j)
a'000011'b'001001' (-0.15695385852556018-0.010785286953011442j)
a'000011'b'010001' (-0.013526196275027718+0.012967928788697907j)
a'000011'b'100001' (0.014555255701389928+0.047049062782642245j)
a'000011'b'000110' (0.10497159656468676+0.02626047817047409j)
a'000011'b'001010' (-0.057943837009794504-0.000905939522254106j)
a'000011'b'010010' (-0.03736416725197458-0.03491130185092892j)
a'000011'b'100010' (-0.012509218311550118-0.016215899021082385j)
a'000011'b'001100' (-0.03548730197534459-0.078031572428781j)
a'000011'b'010100' (0.022936057792034052-0.005710837216545685j)
a'000011'b'100100' (0.0757636662056759-0.02324123806123462j)
a'000011'b'011000' (0.04687990797640547-0.03616772443424102j)
a'000011'b'101000' (0.009420654007763022+0.03754937636093392j)
a'000011'b'110000' (0.0531276038144115-0.04195691390510993j)
a'000101'b'000011' (0.0039016651290579157-0.05848985656255358j)
a'000101'b'000101' (0.015068564012470254+0.050412078479263794j)
a'000101'b'001001' (-0.023847352169524064-0.04005133745304817j)
a'000101'b'010001' (0.02358831250510509+0.035186307415799284j)
a'000101'b'100001' (0.020739735412871708-0.02146040065343159j)
a'000101'b'000110' (-0.007761451097978513-0.024471303099471698j)
a'000101'b'001010' (-0.0037294362371345594+0.014719386013784344j)
a'000101'b'010010' (-0.006323414523563076-0.01780241513171335j)
a'000101'b'100010' (0.030189239397421207-0.027529591304706613j)
a'000101'b'001100' (-0.05173208138926948-0.10004142826329694j)
a'000101'b'010100' (-0.00677674739941673-0.003277084669905136j)
a'000101'b'100100' (0.053910973729686056-0.0008283444081264579j)
a'000101'b'011000' (-0.07437135211977484-0.06758009662876838j)
a'000101'b'101000' (0.004304011298266857-0.03574479298943667j)
a'000101'b'110000' (0.04439726020960856-0.07621755140098006j)
a'001001'b'000011' (0.05784369008255519+0.03562708662945105j)
a'001001'b'000101' (0.033072964503997423+0.10114134042101812j)
a'001001'b'001001' (0.011655189524798517-0.016725071708274676j)
a'001001'b'010001' (0.005617431227264481+0.06520093095949173j)
a'001001'b'100001' (0.02899858478325197+0.010160395261391621j)
a'001001'b'000110' (-0.05334329681977464-0.11375507123811125j)
a'001001'b'001010' (-0.14948848631405295-0.0146762700550771j)
a'001001'b'010010' (0.04466060867832348-0.04931529801422506j)
a'001001'b'100010' (-0.0065501912481115455-0.027714883640672552j)
a'001001'b'001100' (-0.05442144190568686-0.0009633280155531427j)
a'001001'b'010100' (-0.0008037923799131871-0.002062375620356235j)
a'001001'b'100100' (0.05919991356799435-0.03726711873008641j)
a'001001'b'011000' (-0.06543979883845831-0.033456569752551985j)
a'001001'b'101000' (-0.0747910073830946-0.012412255390046258j)
a'001001'b'110000' (-0.0049668192134439655-0.01979100888940603j)
a'010001'b'000011' (-0.06636505210791589+0.00899292100214966j)
a'010001'b'000101' (-0.023739961470179163-0.01696014498821583j)
a'010001'b'001001' (-0.03632845466990867+0.011135201331026058j)
a'010001'b'010001' (0.030049262623005904-0.009011233657985262j)
a'010001'b'100001' (0.08449449358995667+0.044651962189613745j)
a'010001'b'000110' (-0.07092455849278931+0.011276471487404745j)
a'010001'b'001010' (0.03004340184222278-0.007287540502943122j)
a'010001'b'010010' (-0.010254046782766195+0.0882568112558299j)
a'010001'b'100010' (-0.03974248138679271+0.03445377571377082j)
a'010001'b'001100' (0.00887427369900722+0.06037100124882312j)
a'010001'b'010100' (-0.04047227373478797+0.05467195668135946j)
a'010001'b'100100' (-0.05606001478643439-0.040493460647907806j)
a'010001'b'011000' (-0.020749756813250225-0.06302516522683947j)
a'010001'b'101000' (0.036830751258845204-0.04516777818829516j)
a'010001'b'110000' (0.04214013703185053-0.07270157314227234j)
a'100001'b'000011' (0.01869139877056079-0.008345025758438906j)
a'100001'b'000101' (0.07120286533694857-0.034790111419400624j)
a'100001'b'001001' (-0.005982263934361413-0.04323054536640483j)
a'100001'b'010001' (-0.002922150278715855-0.0034580863117394j)
a'100001'b'100001' (0.02850531036517827+0.0035404817680252535j)
a'100001'b'000110' (-0.009417760821526067+0.127701642884906j)
a'100001'b'001010' (0.017996391039347796+0.021833267129592535j)
a'100001'b'010010' (0.023438968722747977+0.044073935087184976j)
a'100001'b'100010' (0.03990082543297206-0.04306965065707684j)
a'100001'b'001100' (0.001096126115410349-0.028594049413390676j)
a'100001'b'010100' (0.03146245217866718+0.04979712924645441j)
a'100001'b'100100' (-0.0033863490009966996-0.059418851833897196j)
a'100001'b'011000' (0.019474608062921547+0.04151717869459959j)
a'100001'b'101000' (0.10769704904215824+0.045866174748874944j)
a'100001'b'110000' (0.040621826872844734+0.008915907499414368j)
a'000110'b'000011' (0.020745601284637392-0.03530445829054895j)
a'000110'b'000101' (-0.008623723329230414+0.012823798943801024j)
a'000110'b'001001' (0.07500881931930842+0.037257118766204377j)
a'000110'b'010001' (-0.07434419007834564+0.11350211700787005j)
a'000110'b'100001' (-0.04840060289635888-0.002612481567785034j)
a'000110'b'000110' (0.07298744691709-0.061551225535681986j)
a'000110'b'001010' (0.07253001298597511-0.039121417255582075j)
a'000110'b'010010' (-0.01999955335022467-0.01721073299669426j)
a'000110'b'100010' (-0.003601451529888486+0.021017654409232568j)
a'000110'b'001100' (0.025399291705289637-0.05065963360505536j)
a'000110'b'010100' (-0.04566289003607006+0.10398074689584348j)
a'000110'b'100100' (-0.00029278145047159816-0.012846532891294647j)
a'000110'b'011000' (0.01813339496013119+0.0282423018895686j)
a'000110'b'101000' (0.02645181054359717-0.01044123516881669j)
a'000110'b'110000' (0.03615380304962789+0.08821303112304006j)
a'001010'b'000011' (0.04452507435282662-0.055189962829726116j)
a'001010'b'000101' (-0.05685507413591413+0.004459830127187207j)
a'001010'b'001001' (0.02499639524734925+0.06917371049208523j)
a'001010'b'010001' (-0.024391255040476553+0.06482604388996044j)
a'001010'b'100001' (0.01638000544222494+0.06886401372251308j)
a'001010'b'000110' (0.052228914524893796-0.030346072578152396j)
a'001010'b'001010' (-0.005386284406556813+0.0242194618637929j)
a'001010'b'010010' (-0.0003236276120335349+0.13070016885910143j)
a'001010'b'100010' (-0.07006146840110887+0.003652398394325282j)
a'001010'b'001100' (0.0038125092556048797+0.03948550722367859j)
a'001010'b'010100' (-0.07712978482230534+0.0029402318723038574j)
a'001010'b'100100' (0.06278517801993364+0.002362356373791382j)
a'001010'b'011000' (0.024209470356857908+0.03607784743252267j)
a'001010'b'101000' (-0.015008873710910257-0.020105506688692366j)
a'001010'b'110000' (-0.05249093990030316+0.08219581451263906j)
a'010010'b'000011' (-0.0047322567368923985+0.030572637734629527j)
a'010010'b'000101' (-0.025002923472201295-0.03433969103296591j)
a'010010'b'001001' (0.012854693220665734+0.0049902421507151355j)
a'010010'b'010001' (0.01268218915111435+0.037264656738849294j)
a'010010'b'100001' (0.029958015172849094-0.08291284400140204j)
a'010010'b'000110' (0.06823477135936308+0.0931231832324556j)
a'010010'b'001010' (0.013615622743359063+0.0024986653839842647j)
a'010010'b'010010' (-0.010687936130677091-0.02162658106701491j)
a'010010'b'100010' (0.015028305434293019+0.018977330952081192j)
a'010010'b'001100' (-0.018153878547420947-0.033876935627172304j)
a'010010'b'010100' (-0.0018714430881003668-8.463347651978628e-05j)
a'010010'b'100100' (0.02613306822409026+0.04190550720486587j)
a'010010'b'011000' (0.01751939108899308+0.001406517443343213j)
a'010010'b'101000' (0.04583444658697571+0.030200549467998876j)
a'010010'b'110000' (-0.02810732287701203+0.01030184824072081j)
a'100010'b'000011' (-0.10151441059054346+0.02579392281017926j)
a'100010'b'000101' (-0.02204207105900776+0.02641988746054241j)
a'100010'b'001001' (-0.06446812221893537-0.036761731839151546j)
a'100010'b'010001' (0.04637561396233313+0.006605139568872254j)
a'100010'b'100001' (-0.05709747688523674-0.05927208295985601j)
a'100010'b'000110' (-0.07434834964322848-0.012544724181340002j)
a'100010'b'001010' (-0.029373407439583204+0.07694145955344908j)
a'100010'b'010010' (-0.012244742496944124+0.04499702332023952j)
a'100010'b'100010' (-0.09319961176135627+0.03332365096589032j)
a'100010'b'001100' (-0.06145891117637857-0.046001911139160974j)
a'100010'b'010100' (-0.0014566208432853236+0.03767809174284021j)
a'100010'b'100100' (0.031199824943633995-0.011494267653092402j)
a'100010'b'011000' (0.022758823158214606-0.013767309818459155j)
a'100010'b'101000' (0.03836517817387885+0.04352241743785215j)
a'100010'b'110000' (-0.040656738669821293-0.04550728860740057j)
a'001100'b'000011' (0.015517276936746548-0.04940356128728112j)
a'001100'b'000101' (0.10288542779214381+0.0497174350573405j)
a'001100'b'001001' (-0.07841884652872286+0.00786187336221558j)
a'001100'b'010001' (0.09205812696946142-0.09996148014592957j)
a'001100'b'100001' (-0.02434078062100746+0.04425351013247236j)
a'001100'b'000110' (-0.030532428820676017-0.019830667968916436j)
a'001100'b'001010' (-0.06444222746262492+0.01943177594107842j)
a'001100'b'010010' (0.06674164775218198+0.0004353640934502273j)
a'001100'b'100010' (0.06506553687726802-0.033493902773541785j)
a'001100'b'001100' (-0.05938414335326707-0.08523986199733775j)
a'001100'b'010100' (-0.04150443037138625-0.00349758921472745j)
a'001100'b'100100' (-0.0017085599909360339-0.023907956354912805j)
a'001100'b'011000' (0.030789066668630873-0.039549334714275956j)
a'001100'b'101000' (-0.04652959278020205+0.0002775712105908927j)
a'001100'b'110000' (0.060817765348226235-0.0033816437811132367j)
a'010100'b'000011' (-0.02991324984130989-0.07907166785554194j)
a'010100'b'000101' (-0.004156842097655062-0.019003057736991638j)
a'010100'b'001001' (-0.01895940885420437+0.051824449170060974j)
a'010100'b'010001' (0.013926980722554317+0.028360559400531386j)
a'010100'b'100001' (0.047405443404450506-0.02146170781738339j)
a'010100'b'000110' (0.01989582792441566-0.00014185290195086256j)
a'010100'b'001010' (8.789404703008624e-05-0.05037593161125273j)
a'010100'b'010010' (0.011994265224936716-0.004439589741432666j)
a'010100'b'100010' (0.006849605960824085-0.01343189486050152j)
a'010100'b'001100' (-0.0009215980725758811-0.0017578205307125481j)
a'010100'b'010100' (-0.021975785361580586+0.058694276895135504j)
a'010100'b'100100' (-0.011092877549309751+0.02064417705611041j)
a'010100'b'011000' (0.012771465443592778-0.04044885579758599j)
a'010100'b'101000' (0.023751083839260993+0.061778287798645776j)
a'010100'b'110000' (0.0021028780715198784-0.030863289761896878j)
a'100100'b'000011' (0.04816775095664032-0.00532486370015935j)
a'100100'b'000101' (0.06599657255715768+0.07717569452406634j)
a'100100'b'001001' (0.05057303019052096-0.03900181658338296j)
a'100100'b'010001' (-0.06683122179270697-0.005536938101783635j)
a'100100'b'100001' (0.0028673508872835707+0.0052981721513769954j)
a'100100'b'000110' (0.025396659458346883-0.047401242940062566j)
a'100100'b'001010' (-0.0157832919796197+0.003830482086903447j)
a'100100'b'010010' (-0.0062256177657024694+0.059163342613024125j)
a'100100'b'100010' (0.07134118108109225-0.06412227321369292j)
a'100100'b'001100' (0.018253463658784632-0.038385128186716404j)
a'100100'b'010100' (0.05357019424235329+0.008655525540211054j)
a'100100'b'100100' (0.010738140333403687-0.01099631762665661j)
a'100100'b'011000' (-0.053758877664864854-0.013614126975915988j)
a'100100'b'101000' (0.017613636196442073-0.0006616466313767132j)
a'100100'b'110000' (0.049754411105398924-0.02973689500710542j)
a'011000'b'000011' (0.017221176805942928-0.022352035633277565j)
a'011000'b'000101' (-0.001334943564094266-0.03316720610461704j)
a'011000'b'001001' (-0.12518335932106012-0.027127546769773164j)
a'011000'b'010001' (-0.006943781924368949+0.07038363143556936j)
a'011000'b'100001' (0.03221586277085103-0.05300184117064215j)
a'011000'b'000110' (-0.05293851053848496+0.07482591322547688j)
a'011000'b'001010' (-0.012125261797298656+0.1318460425153758j)
a'011000'b'010010' (0.017458336494875326-0.012533371817639093j)
a'011000'b'100010' (-0.1123771298234029-0.10781953580063472j)
a'011000'b'001100' (-0.04709459955776184-0.02205728977348165j)
a'011000'b'010100' (-0.035917313537425395+0.04077307596207373j)
a'011000'b'100100' (0.015594150103128666+0.07678239781346805j)
a'011000'b'011000' (0.0015989982691126216+0.005207161133909622j)
a'011000'b'101000' (0.011080696320397827-0.020495437085892246j)
a'011000'b'110000' (0.040865789551663506-0.023667211032537397j)
a'101000'b'000011' (-0.006317555025899514-0.01913207328206941j)
a'101000'b'000101' (0.08094601747554839+0.034070841249909216j)
a'101000'b'001001' (0.16332898971130147+0.006169482304450254j)
a'101000'b'010001' (0.010094917831534128-0.04807343717424952j)
a'101000'b'100001' (0.0032669700953906027+0.013866483603477123j)
a'101000'b'000110' (0.016063069933809043-0.07574515891089105j)
a'101000'b'001010' (0.002823504674216524+0.05263775909017124j)
a'101000'b'010010' (-0.007521165123080809+0.0154752706628342j)
a'101000'b'100010' (-0.06632451296777034-0.0552398725457041j)
a'101000'b'001100' (-0.10599969192037662-0.04335556166799583j)
a'101000'b'010100' (-0.0050040902319118345-0.03588644770749852j)
a'101000'b'100100' (-0.016002115745365652+0.01066840580278972j)
a'101000'b'011000' (0.06845852784841014-0.06831997969450458j)
a'101000'b'101000' (0.04827246905260506+0.0668409686695978j)
a'101000'b'110000' (0.02372784081078969-0.09969017513257487j)
a'110000'b'000011' (0.004472326003436064-0.007703881828819256j)
a'110000'b'000101' (-0.057014737700846904-0.09253099953919877j)
a'110000'b'001001' (-0.047947336845502724-0.011629542788661806j)
a'110000'b'010001' (-0.03601154775737256+0.055363943858600474j)
a'110000'b'100001' (0.05782835601984124-0.009607633291818962j)
a'110000'b'000110' (0.014652956388058837+0.012070896717241854j)
a'110000'b'001010' (-0.0336269079533598-0.03010318201927978j)
a'110000'b'010010' (-0.05758177724579806-0.007569618060248858j)
a'110000'b'100010' (-0.058858802251420664+0.03108634629050893j)
a'110000'b'001100' (0.06360178932301028+0.02189798010156003j)
a'110000'b'010100' (0.03232250190922749+0.12531599585711528j)
a'110000'b'100100' (-0.0027697071230061935+0.05950887870995135j)
a'110000'b'011000' (0.005668148465267409-0.07320654485521362j)
a'110000'b'101000' (-0.0622974748990675-0.02144356709957164j)
a'110000'b'110000' (0.10991094364185812-0.013170712167275653j)
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