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 -q 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.7999079941589498+0.6001226548636583j)

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.09384210203295683+0.005235046713196483j)
a'000011'b'000101' (0.05561923883648112-0.04058787815931415j)
a'000011'b'001001' (0.08576691356726651+0.09731518173262758j)
a'000011'b'010001' (0.0036939384343366824-0.019286112431539233j)
a'000011'b'100001' (0.06816538464588703-0.027579019908412532j)
a'000011'b'000110' (-0.06037032527608687-0.02975496240171033j)
a'000011'b'001010' (0.04886126135682565-0.008001983149139615j)
a'000011'b'010010' (0.0014798587429770823+0.021983953899922543j)
a'000011'b'100010' (-0.06628098467490198-0.05318742569624077j)
a'000011'b'001100' (0.06618047707409606-0.026161502460500217j)
a'000011'b'010100' (-0.027184538365766626+0.04522154569598702j)
a'000011'b'100100' (0.09646841389290652+0.011337596749133677j)
a'000011'b'011000' (-0.030991711594140204-0.011464810757845695j)
a'000011'b'101000' (0.0007437856781236647-0.08852223164445806j)
a'000011'b'110000' (0.08986963331865674-0.04816831923032934j)
a'000101'b'000011' (-0.14827662633339528+0.049677650471694715j)
a'000101'b'000101' (0.058458409624265455+0.0600595351070944j)
a'000101'b'001001' (-0.008735040117550668+0.13274020415614182j)
a'000101'b'010001' (-0.011109804561732991+0.013498016854540844j)
a'000101'b'100001' (0.017959605082221566-0.01160930218069445j)
a'000101'b'000110' (0.02666506902538217-0.028067648040625972j)
a'000101'b'001010' (-0.043051427923496956-0.020810826575262974j)
a'000101'b'010010' (0.014923146019156194-0.04927417375795368j)
a'000101'b'100010' (-0.06560922880808695+0.019239558954295324j)
a'000101'b'001100' (-0.02274512957075045-0.01231548461108956j)
a'000101'b'010100' (-0.022016905699977284-0.021452900988919655j)
a'000101'b'100100' (0.009558682011889745-0.03148005023266555j)
a'000101'b'011000' (-0.06655043888237985+0.07488942706160276j)
a'000101'b'101000' (0.024694367039919972+0.04754307082214243j)
a'000101'b'110000' (-0.011906852805009147-0.05856274572991746j)
a'001001'b'000011' (-0.047371038428343046-0.021901888660557273j)
a'001001'b'000101' (-0.07160061018891911+0.04467945381986033j)
a'001001'b'001001' (0.02033990764706838+0.0726948267333167j)
a'001001'b'010001' (-0.011812979009392821-0.03701509032402448j)
a'001001'b'100001' (0.03926515282585058-0.033567585220018716j)
a'001001'b'000110' (0.061806023684025976+0.028440519939150755j)
a'001001'b'001010' (0.03334002920426961+0.020999425000328874j)
a'001001'b'010010' (0.02433862567062296-0.010645538219167264j)
a'001001'b'100010' (-0.013296060925526395+0.08890898072536728j)
a'001001'b'001100' (0.02750194040317994-0.052223282647757205j)
a'001001'b'010100' (-0.0192712820505212-0.05279836309207878j)
a'001001'b'100100' (-0.06098307085375363+0.012438637441151429j)
a'001001'b'011000' (-0.0005940405613191028+0.03301520206753921j)
a'001001'b'101000' (-0.07840014346971613-5.7398732133186957e-05j)
a'001001'b'110000' (0.000732372685034117+0.017720196769286736j)
a'010001'b'000011' (-0.018711677102450808-0.03748570304317249j)
a'010001'b'000101' (0.012847838514269237-0.024064494064899515j)
a'010001'b'001001' (-0.058607348569206984+0.05942305032261784j)
a'010001'b'010001' (-0.018815503072724702+0.011632899980122449j)
a'010001'b'100001' (0.028093432743052583+0.048278676389273856j)
a'010001'b'000110' (0.022575769272818846+0.006128249241724099j)
a'010001'b'001010' (0.03439097257357402-0.017608390656763593j)
a'010001'b'010010' (-0.0310846805762318-0.005150738961448813j)
a'010001'b'100010' (0.04029725060264902+0.07110140450611532j)
a'010001'b'001100' (0.023799881347323713+0.015058645512088607j)
a'010001'b'010100' (0.008162430907788605+0.011565889779826897j)
a'010001'b'100100' (-0.006995969716417116+0.02884890934511133j)
a'010001'b'011000' (0.0034325756378969915-0.04112161602784415j)
a'010001'b'101000' (0.008913467629328506+0.019100975005447968j)
a'010001'b'110000' (-0.031357786780051834-0.05481723578275151j)
a'100001'b'000011' (0.020481066256512526+0.07422766148255913j)
a'100001'b'000101' (0.01441051563240256-0.022854562740734094j)
a'100001'b'001001' (-0.04905409001712362-0.03963791036625446j)
a'100001'b'010001' (-0.021276625264354483-0.060137308288853546j)
a'100001'b'100001' (0.04403579127700939-0.02567581181713398j)
a'100001'b'000110' (-0.04330538491445501-0.04274109699497559j)
a'100001'b'001010' (0.10407808681623033+0.05981594433323129j)
a'100001'b'010010' (0.06983148601565238-0.048160522348070715j)
a'100001'b'100010' (0.036352010003676716-0.03187412279224139j)
a'100001'b'001100' (-0.008005958506257385-0.03925663732727647j)
a'100001'b'010100' (-0.1210450620768181-0.013381271541707259j)
a'100001'b'100100' (-0.049867226400769106+0.020047125709862952j)
a'100001'b'011000' (0.05158440812561112-0.04518369075124467j)
a'100001'b'101000' (-0.00825350471484437-0.027334312414799538j)
a'100001'b'110000' (0.021111852005804097+0.06663948529400913j)
a'000110'b'000011' (0.0908679431670241+0.0374423079588566j)
a'000110'b'000101' (0.07862476553728358-0.05267322168026688j)
a'000110'b'001001' (0.0028168081387931754+0.049735659611796434j)
a'000110'b'010001' (-0.008346672301724712+0.029523317204298103j)
a'000110'b'100001' (0.052414695598025036+0.03269134076650227j)
a'000110'b'000110' (0.0027249457895774445-0.0217577020171407j)
a'000110'b'001010' (-0.08589885646735153-0.017373073686634696j)
a'000110'b'010010' (0.016015561337990456-0.08560374113123319j)
a'000110'b'100010' (-0.0508437186359046+0.03438564310869367j)
a'000110'b'001100' (0.0099555979139572-0.002035678412752289j)
a'000110'b'010100' (-0.039856531343831283-0.09926570268870157j)
a'000110'b'100100' (0.007662458734102419-0.06725295515961098j)
a'000110'b'011000' (0.08320662058583583+0.05402978856086725j)
a'000110'b'101000' (-0.004279844232290856+0.030847300651352796j)
a'000110'b'110000' (0.015606673323991302+0.016045057355933066j)
a'001010'b'000011' (-0.058008583434729775-0.03369992397753459j)
a'001010'b'000101' (0.0009132412045340614+0.01800923009107595j)
a'001010'b'001001' (-0.10372591103006534+0.07148205815428799j)
a'001010'b'010001' (-0.07291295660739557-0.0007694320123195779j)
a'001010'b'100001' (-0.0327421176919494+0.021265046348657394j)
a'001010'b'000110' (-0.11420534291459543-0.00804559394729926j)
a'001010'b'001010' (0.01154011717555771+0.045176910796864624j)
a'001010'b'010010' (0.06106627604428032-0.021888621145569394j)
a'001010'b'100010' (-0.012349228554306755+0.05482390041929331j)
a'001010'b'001100' (-0.05323688068083007-0.018995440204020976j)
a'001010'b'010100' (0.012516932560967576-0.03643804088765462j)
a'001010'b'100100' (-0.02587726222153636-0.05821953776497998j)
a'001010'b'011000' (-0.09290039924497283+0.02944430002779764j)
a'001010'b'101000' (0.05493757372493251-0.04740172545807346j)
a'001010'b'110000' (-0.08186789011560684-0.057430602054633156j)
a'010010'b'000011' (-0.03627258471972449+0.00224202471736903j)
a'010010'b'000101' (0.013581031913346062+0.03291319903620784j)
a'010010'b'001001' (-0.04287125194686658+0.018047108348590003j)
a'010010'b'010001' (-0.015142893637276588+0.0966556148678651j)
a'010010'b'100001' (-0.008619318066245012-0.02322364098086677j)
a'010010'b'000110' (0.08944306433558959+0.09880968326830322j)
a'010010'b'001010' (-0.009212729985197829+0.01571187703706387j)
a'010010'b'010010' (0.0043998861068366415-0.016547005001423764j)
a'010010'b'100010' (0.06017493958147038+0.004997699182355966j)
a'010010'b'001100' (-0.028834298352185896+0.005200507676068912j)
a'010010'b'010100' (-0.034978581746361766+0.047569653686973405j)
a'010010'b'100100' (0.034606374958448496+0.010595758663957273j)
a'010010'b'011000' (-0.06819985012458016+0.05279138918577193j)
a'010010'b'101000' (-0.040179544352970394+0.06919886826171809j)
a'010010'b'110000' (-0.07331801661883831-0.06690584321145335j)
a'100010'b'000011' (0.005452898050775502-0.029409014401281842j)
a'100010'b'000101' (0.005047444448177916+0.01009845083513581j)
a'100010'b'001001' (0.025189147092344058-0.0020518147867863196j)
a'100010'b'010001' (0.026016220769922684-0.008973808778358894j)
a'100010'b'100001' (0.0032166624240781145+0.018193003854926046j)
a'100010'b'000110' (0.08992259613184937+0.04773141523536774j)
a'100010'b'001010' (-0.032636094696931905-0.05116090075830812j)
a'100010'b'010010' (-0.02230079108419756+0.018660568270378586j)
a'100010'b'100010' (-0.09196526240710995+0.008828654480316748j)
a'100010'b'001100' (-0.004331879844194363+0.02249297100881403j)
a'100010'b'010100' (-0.02533678739347054-0.04301972831585189j)
a'100010'b'100100' (-0.09294709302120199-0.06739313423138951j)
a'100010'b'011000' (0.01085095413734894+0.07711050406280395j)
a'100010'b'101000' (-0.02156345432045851+0.03744376587269528j)
a'100010'b'110000' (0.07367563373750792+0.07377199851677536j)
a'001100'b'000011' (-0.013929432256326885-0.08376588884215666j)
a'001100'b'000101' (-0.09580459755899176-0.001089466940047542j)
a'001100'b'001001' (0.058511048366317014-0.07218806688503626j)
a'001100'b'010001' (0.02524832432006486-0.023517385909918316j)
a'001100'b'100001' (-0.11384994606726262-0.0020028792968888767j)
a'001100'b'000110' (-0.05080840709312792-0.08421576890498352j)
a'001100'b'001010' (0.051369989342579025-0.04950636021543738j)
a'001100'b'010010' (0.006988227137253055-0.052836997771149856j)
a'001100'b'100010' (0.05497738000039161-0.040958985992495915j)
a'001100'b'001100' (-0.009451036627229816+0.06763534580849655j)
a'001100'b'010100' (0.050471681919062907+0.010237203620385245j)
a'001100'b'100100' (-0.023463306887576793+0.04280121785965477j)
a'001100'b'011000' (0.12126526372525154-0.003093475740772517j)
a'001100'b'101000' (0.03760535545256546+0.030144365764309032j)
a'001100'b'110000' (0.06303325232866612-0.05114032052978237j)
a'010100'b'000011' (-0.060066305787707476-0.03933555442204866j)
a'010100'b'000101' (-0.030308258134753876+0.029334483872241923j)
a'010100'b'001001' (0.07175335940970705+0.013335706690600696j)
a'010100'b'010001' (-0.008502020767554672-0.014289002150801955j)
a'010100'b'100001' (0.021183832331766274+0.03828880241110249j)
a'010100'b'000110' (-0.03484401143278352+0.01648478703467965j)
a'010100'b'001010' (0.013556286619437944+0.06238750060819261j)
a'010100'b'010010' (-0.05626622135880605-0.059596589612100036j)
a'010100'b'100010' (-0.014444147930629439+0.01800157790904363j)
a'010100'b'001100' (-0.045773690257768+0.009630892974864505j)
a'010100'b'010100' (-0.07434795410000382-0.014068765506232494j)
a'010100'b'100100' (0.050296675172384814-0.016759665124657923j)
a'010100'b'011000' (-0.01385615535830302-0.06322247329897543j)
a'010100'b'101000' (0.007682227386239724-0.008263149278186032j)
a'010100'b'110000' (-0.007534641267705443-0.013649630179576067j)
a'100100'b'000011' (-0.0071019479700859265+0.0009578662787568972j)
a'100100'b'000101' (0.049957947063618294-0.016618344129695917j)
a'100100'b'001001' (-0.08663386537712799-0.018144163591383558j)
a'100100'b'010001' (-0.02123380453246934-0.0704688753564839j)
a'100100'b'100001' (0.01839300270634542+0.02076897039193945j)
a'100100'b'000110' (0.0045125432346768135+0.04129550087218009j)
a'100100'b'001010' (-0.09772682875312054+0.044138412827823166j)
a'100100'b'010010' (-0.06243315121306364+0.054141055109058554j)
a'100100'b'100010' (0.02221607272954653+0.05926755208898666j)
a'100100'b'001100' (0.08991598395351297+0.058523164624570766j)
a'100100'b'010100' (0.005285149190557608+0.011695585711756155j)
a'100100'b'100100' (-0.047421912282458886+0.02858797396579243j)
a'100100'b'011000' (-0.10420164372275567+0.024806414757237834j)
a'100100'b'101000' (0.021297867283368875+0.012029463378030503j)
a'100100'b'110000' (0.04640831514729045-0.03471349666102114j)
a'011000'b'000011' (-0.009731945202398219-0.009667492175605794j)
a'011000'b'000101' (-0.027299040057600237+0.06924340013801394j)
a'011000'b'001001' (-0.02127891804749408-0.020879194457582767j)
a'011000'b'010001' (-0.003048441401057468-0.023735893648973855j)
a'011000'b'100001' (0.05879396707108365-0.024391290019333982j)
a'011000'b'000110' (0.018972775061024943+0.054413911812738344j)
a'011000'b'001010' (-0.02059422117495651+0.09072235161125249j)
a'011000'b'010010' (-0.020825901797909926+0.01738440025367059j)
a'011000'b'100010' (-0.123492965484383+0.003290822904144818j)
a'011000'b'001100' (0.02005148685418542+0.009046146575202033j)
a'011000'b'010100' (-0.020269409151587432+0.006718386285727332j)
a'011000'b'100100' (0.052696204520226664-0.0331111482960654j)
a'011000'b'011000' (0.052856707775489675-0.02864469966081306j)
a'011000'b'101000' (-0.0685446560730113-0.005938005773578099j)
a'011000'b'110000' (3.3304062125815166e-07-0.045433501578705696j)
a'101000'b'000011' (0.052374617058487935-0.017578280844306668j)
a'101000'b'000101' (0.02418729444087495+0.029892949794508857j)
a'101000'b'001001' (0.057338590987012265+0.03309725534141412j)
a'101000'b'010001' (-0.04611127376943059-0.0004079521336867004j)
a'101000'b'100001' (0.03661054806676521-0.05266908186712175j)
a'101000'b'000110' (-0.024467455524209654+0.10694058706785588j)
a'101000'b'001010' (-0.009156112314973671+0.008079806816646032j)
a'101000'b'010010' (-0.030033931054981818+0.039404409363809886j)
a'101000'b'100010' (-0.038601154043087844+0.04597409728455378j)
a'101000'b'001100' (-0.032098588839300043-0.023187020646330575j)
a'101000'b'010100' (-0.0031219335608729374-0.06261382305617119j)
a'101000'b'100100' (0.006474701170412235-0.04380759624977337j)
a'101000'b'011000' (0.09367864097885499-0.05330403147722397j)
a'101000'b'101000' (-0.05738162855682304-0.018166210103435523j)
a'101000'b'110000' (0.11751708876575592+0.05337633743935052j)
a'110000'b'000011' (-0.028206159598157116-0.0014820053947652157j)
a'110000'b'000101' (0.07186821680735272+0.013143503175659j)
a'110000'b'001001' (-0.027470572632717936-0.05174919043697992j)
a'110000'b'010001' (0.036338413710609314-0.019942971850002277j)
a'110000'b'100001' (-0.10830189330526861-0.012174288059871087j)
a'110000'b'000110' (-0.006529759805794204+0.10764601063047234j)
a'110000'b'001010' (-0.05045899300608981+0.035698544095339596j)
a'110000'b'010010' (0.017219826569635673-0.05577154998679974j)
a'110000'b'100010' (0.014984683638108127+0.008988887674193051j)
a'110000'b'001100' (-0.0446845405772626-0.007609019393146989j)
a'110000'b'010100' (0.04880357125812102+0.020676510186474543j)
a'110000'b'100100' (0.008970803650406985-0.01486778788950751j)
a'110000'b'011000' (0.016731121896152706-0.05971117393571572j)
a'110000'b'101000' (-9.789915213915808e-05-0.03428732638467109j)
a'110000'b'110000' (-0.04368987913087354-6.628385314808618e-05j)

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)) @ cirq_wfn
# recover a fqe wavefunction
from_cirq_wfn = fqe.from_cirq(final_cirq_wfn.flatten(), 1.0E-8)
/home/kbuilder/.local/lib/python3.6/site-packages/scipy/sparse/_index.py:82: SparseEfficiencyWarning: Changing the sparsity structure of a csc_matrix is expensive. lil_matrix is more efficient.
  self._set_intXint(row, col, x.flat[0])
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.08209236002021324-0.045766693723328145j)
a'000011'b'000101' (0.062316055083814485+0.029284549868759457j)
a'000011'b'001001' (-0.0050543202387648145+0.12961736729865064j)
a'000011'b'010001' (0.013524589258294226-0.014236741174618378j)
a'000011'b'100001' (0.051859879574508605+0.05213132353535456j)
a'000011'b'000110' (-0.05137143733810939+0.043484587928189336j)
a'000011'b'001010' (-0.022394757878697914-0.04415800510953405j)
a'000011'b'010010' (-0.013954641067604906-0.01705145752266943j)
a'000011'b'100010' (-0.07913610600689945+0.03097657030293214j)
a'000011'b'001100' (0.0689209086489859-0.01772535211903716j)
a'000011'b'010100' (-0.04221644283835465-0.03165058096417843j)
a'000011'b'100100' (-0.05891520649800415+0.07722495984043383j)
a'000011'b'011000' (-0.011834865871954186-0.0308522936431059j)
a'000011'b'101000' (0.07193359096429036+0.051597453458792304j)
a'000011'b'110000' (0.048657198829559795-0.08960588692918238j)
a'000101'b'000011' (-0.1147982030201764-0.10618474210798633j)
a'000101'b'000101' (-0.0814304016949147-0.019839936816521127j)
a'000101'b'001001' (-0.008015663911965627+0.13278558602995977j)
a'000101'b'010001' (0.012311153312854053-0.01241207962078775j)
a'000101'b'100001' (0.0118386181349055+0.017809279392718903j)
a'000101'b'000110' (-0.02607917142258411+0.028612857085099405j)
a'000101'b'001010' (-0.04012811374821017-0.026004815631117843j)
a'000101'b'010010' (0.04749726408811876+0.01986591026813452j)
a'000101'b'100010' (0.016880444829371136-0.06625543084087726j)
a'000101'b'001100' (-0.024048597415467263-0.009522449408896416j)
a'000101'b'010100' (-0.02444747499549891+0.018635773764095167j)
a'000101'b'100100' (-0.005470780378555488+0.03244121647696312j)
a'000101'b'011000' (-0.061193009926344674-0.07932718788162592j)
a'000101'b'101000' (-0.01762225463231267+0.05059260309942029j)
a'000101'b'110000' (0.05722171857652767-0.017234942828329554j)
a'001001'b'000011' (-0.019180638014521925-0.048536698837424834j)
a'001001'b'000101' (-0.07135746509539255+0.04506676323219158j)
a'001001'b'001001' (-0.04498386537696522-0.060619316497509915j)
a'001001'b'010001' (0.022885306085804427+0.03139946098472216j)
a'001001'b'100001' (0.011873840328229447+0.05027471451734293j)
a'001001'b'000110' (0.05778788122323962+0.03590833499019916j)
a'001001'b'001010' (-0.03926830393032471+0.003245566841344104j)
a'001001'b'010010' (0.024058730212753187+0.011263821911785307j)
a'001001'b'100010' (-0.06501953497006399-0.06208101289473025j)
a'001001'b'001100' (0.02615277267435083-0.05291181775266589j)
a'001001'b'010100' (0.05546276250950003-0.009106669637607638j)
a'001001'b'100100' (-0.05090587616035035-0.03580846833492637j)
a'001001'b'011000' (0.025897062226205515-0.020486547288427522j)
a'001001'b'101000' (0.05219754422970293+0.05849788173151854j)
a'001001'b'110000' (-0.017510532032564047+0.0028147844017921927j)
a'010001'b'000011' (0.004496328537947819-0.04165438539105011j)
a'010001'b'000101' (-0.015019479991500755+0.02277239666511262j)
a'010001'b'001001' (0.03687222287206382-0.0748756261838908j)
a'010001'b'010001' (0.02204068869913772-0.0018856191277531083j)
a'010001'b'100001' (-0.024033323162404613+0.050422920730160734j)
a'010001'b'000110' (-0.008396547461079278+0.021833890806773j)
a'010001'b'001010' (0.035923603108446625+0.014222839230769783j)
a'010001'b'010010' (-0.03131057339347859-0.003526396481812538j)
a'010001'b'100010' (0.07272160936461196+0.03729404322805071j)
a'010001'b'001100' (-0.019225551271367294+0.02058094592377768j)
a'010001'b'010100' (0.00715849560685896-0.0122127402891451j)
a'010001'b'100100' (-0.029369497910840085-0.004316915002711681j)
a'010001'b'011000' (-0.012199273651536677+0.0394201420929232j)
a'010001'b'101000' (-0.01791792941734426+0.011101574515937112j)
a'010001'b'110000' (-0.04755655758907737-0.04155254457769986j)
a'100001'b'000011' (-0.06047214107663691+0.04766906709576317j)
a'100001'b'000101' (0.023037449459385167+0.014116299843377648j)
a'100001'b'001001' (0.05769421807162242-0.025472433859279452j)
a'100001'b'010001' (0.03767078636692812-0.05147914612117846j)
a'100001'b'100001' (-0.0201846184927622-0.046807898929164246j)
a'100001'b'000110' (0.05884333374592153-0.015479657896384856j)
a'100001'b'001010' (-0.10884595418549484+0.05062364673995904j)
a'100001'b'010010' (0.0319147994687244-0.07859591545916608j)
a'100001'b'100010' (-0.002091762587248254-0.0483016859370445j)
a'100001'b'001100' (0.02305178913266221-0.032768795577996265j)
a'100001'b'010100' (0.002207922767327914-0.12176243492270991j)
a'100001'b'100100' (-0.004093953784326601+0.05358980369943903j)
a'100001'b'011000' (0.05094592359826705+0.0459023958012353j)
a'100001'b'101000' (-0.014431487537941068-0.024637717887622507j)
a'100001'b'110000' (-0.060682417247812745-0.03470123243240494j)
a'000110'b'000011' (0.0705888123086614-0.06838222793638674j)
a'000110'b'000101' (-0.07751913163561873+0.054287256961749034j)
a'000110'b'001001' (-0.003392246417449199+0.049699727457548026j)
a'000110'b'010001' (-0.028519253431140777-0.011311294399331475j)
a'000110'b'100001' (-0.05483849731438182+0.02843876382766552j)
a'000110'b'000110' (-0.02026409863496809+0.008377901475614798j)
a'000110'b'001010' (-0.04808462633256312-0.07326872417462771j)
a'000110'b'010010' (0.06438374180681904-0.05864496987455089j)
a'000110'b'100010' (0.052404955034712805-0.03195585806288441j)
a'000110'b'001100' (-0.010157763826696361+0.00027883770475590347j)
a'000110'b'010100' (-0.0066286961649807165-0.1067627426033814j)
a'000110'b'100100' (0.043429560693432824-0.05191865280925443j)
a'000110'b'011000' (-0.08575969060840942-0.04987820393716231j)
a'000110'b'101000' (0.02959182742185481-0.00970550225195922j)
a'000110'b'110000' (-0.014117627603332484-0.017369649065268652j)
a'001010'b'000011' (-0.01459253564405933+0.06548082567952603j)
a'001010'b'000101' (-0.0013342219103572497+0.01798294274763997j)
a'001010'b'001001' (0.039966518196964375-0.11946307663961178j)
a'001010'b'010001' (-0.04753277235772436-0.055294907711671656j)
a'001010'b'100001' (0.0014767016529390158-0.039013687590283244j)
a'001010'b'000110' (-0.07462755742702523-0.08682349684665552j)
a'001010'b'001010' (-0.02777122905130956-0.03745512529084859j)
a'001010'b'010010' (0.038839512809274876-0.05195858014138459j)
a'001010'b'100010' (-0.0034469294983146184-0.056091730050915195j)
a'001010'b'001100' (0.05538123765271633+0.01130976256261951j)
a'001010'b'010100' (-0.01071230801228274+0.037008794650949965j)
a'001010'b'100100' (-0.04093466633007682+0.04882110578525806j)
a'001010'b'011000' (0.006706016488941601+0.09722386706386635j)
a'001010'b'101000' (0.07254269449097869+0.0016180417712451448j)
a'001010'b'110000' (0.09649686734474833+0.026248429990929988j)
a'010010'b'000011' (0.028249975265045375-0.022861889130323613j)
a'010010'b'000101' (-0.03412565439327373+0.010156909513193174j)
a'010010'b'001001' (-0.041848890544087115-0.02030548505863561j)
a'010010'b'010001' (-0.010093298081341724+0.09731259141054728j)
a'010010'b'100001' (-0.019956199446858523-0.014675838918865789j)
a'010010'b'000110' (0.011796410123479602+0.13275639334330186j)
a'010010'b'001010' (0.0009901784723968512+0.018186726489414745j)
a'010010'b'010010' (-0.0037862990864663028+0.01669809304974977j)
a'010010'b'100010' (0.0033092490786873906-0.06029136937643844j)
a'010010'b'001100' (0.02854410048801626-0.006610322902986796j)
a'010010'b'010100' (0.058390151252649264-0.008772876927110995j)
a'010010'b'100100' (-0.03352672579998076-0.013631945809841721j)
a'010010'b'011000' (0.03059941807366773-0.080633900703933j)
a'010010'b'101000' (0.014318876575799316-0.0787264182261708j)
a'010010'b'110000' (-0.09909096632983222-0.005736184147661735j)
a'100010'b'000011' (-0.02278398788019359-0.01937818674391765j)
a'100010'b'000101' (-0.011261001269421205-0.0008032777459827858j)
a'100010'b'001001' (-0.012831887270124749+0.021772591583131082j)
a'100010'b'010001' (0.016815049648087145-0.021785937952548018j)
a'100010'b'100001' (0.016199473389426795+0.008883094523930452j)
a'100010'b'000110' (-0.08757773509259645-0.051908588995596736j)
a'100010'b'001010' (0.04562111708570954+0.040015823361772035j)
a'100010'b'010010' (0.01927824897777162+0.021769042411312743j)
a'100010'b'100010' (-0.09191251595075856-0.009361839623864521j)
a'100010'b'001100' (0.022109534109921863-0.005988942246347629j)
a'100010'b'010100' (0.021409816198604673+0.04510287784757866j)
a'100010'b'100100' (0.11167376853667105+0.026645188373139332j)
a'100010'b'011000' (-0.03636907443485769-0.06885538081560755j)
a'100010'b'101000' (0.024252756352454927-0.035760620440201785j)
a'100010'b'110000' (0.02385570284517765-0.10149538025715804j)
a'001100'b'000011' (-0.0034006550006444505-0.08484803334236296j)
a'001100'b'000101' (-0.09525397259743619+0.010314482830501057j)
a'001100'b'001001' (0.05663934925850787-0.07366575796865679j)
a'001100'b'010001' (0.018406694180877654+0.02918456664641173j)
a'001100'b'100001' (-0.07669339391966924-0.08416617535613077j)
a'001100'b'000110' (0.0354384076593078+0.09174916471647748j)
a'001100'b'001010' (-0.04388704483001159+0.05624662481363551j)
a'001100'b'010010' (-0.004384899501867533+0.05311644103616936j)
a'001100'b'100010' (-0.060945657319017105-0.0313970969867259j)
a'001100'b'001100' (-0.06203216425655302+0.028563485319760544j)
a'001100'b'010100' (0.0005594744020102696-0.05149638824323299j)
a'001100'b'100100' (0.03397523431996203-0.03504503493041365j)
a'001100'b'011000' (-0.07200558484171111-0.09762187014248752j)
a'001100'b'101000' (-0.0069929201603144-0.047685895332663195j)
a'001100'b'110000' (-0.06083499181426806+0.053736645354693593j)
a'010100'b'000011' (0.04525085860138253-0.055745912213453076j)
a'010100'b'000101' (0.024576795043204275+0.03427949242065911j)
a'010100'b'001001' (-0.02645872043120295+0.06801706971532785j)
a'010100'b'010001' (-0.00949781747470363+0.013647395459015915j)
a'010100'b'100001' (-0.03618145857694817+0.024610753697955248j)
a'010100'b'000110' (-0.0382598038617452+0.004694757157455326j)
a'010100'b'001010' (-0.016603861268971194-0.061646451073896734j)
a'010100'b'010010' (-0.0025378528394146976+0.08192191686207487j)
a'010100'b'100010' (0.015988108542733023-0.016645437869970907j)
a'010100'b'001100' (0.018070076030850524+0.04314460767635581j)
a'010100'b'010100' (0.06822257702422763-0.03272962611914411j)
a'010100'b'100100' (0.03726988631464121-0.03770407779777654j)
a'010100'b'011000' (-0.06276582324089412-0.015796379466381683j)
a'010100'b'101000' (-0.007329234878707198+0.008577795153780479j)
a'010100'b'110000' (0.008714055985612356+0.012928590462684521j)
a'100100'b'000011' (0.0027949854562985396-0.006598729353206331j)
a'100100'b'000101' (-0.04743406855256613+0.022846771696997892j)
a'100100'b'001001' (-0.04627359851936248-0.07545456502215143j)
a'100100'b'010001' (0.06822094145689102-0.02761593734904226j)
a'100100'b'100001' (0.026764589481613244-0.007301330671706708j)
a'100100'b'000110' (-0.01897300346503917+0.03695546750136799j)
a'100100'b'001010' (0.08258049739910672+0.06840463430512014j)
a'100100'b'010010' (0.0670014476969082-0.04837311469436157j)
a'100100'b'100010' (-0.043225826889598494-0.04623553295740963j)
a'100100'b'001100' (-0.07117334262007316-0.08027577634809077j)
a'100100'b'010100' (0.010005179171365081+0.008038402630894326j)
a'100100'b'100100' (0.04471310923863681-0.032662637404346j)
a'100100'b'011000' (0.10307067775584958-0.029150920304203562j)
a'100100'b'101000' (-0.004484476474856717+0.024045719176806254j)
a'100100'b'110000' (0.014849663263264354-0.05602005057309937j)
a'011000'b'000011' (0.0008426755265673359-0.01369164198862961j)
a'011000'b'000101' (-0.0629518593793846-0.03971082284992038j)
a'011000'b'001001' (-0.002639343631603501+0.029694561449259325j)
a'011000'b'010001' (-0.0021295883083790267+0.02383590770094342j)
a'011000'b'100001' (0.03114761871166398+0.05551118302968988j)
a'011000'b'000110' (-0.02162222017445293-0.05341647299296535j)
a'011000'b'001010' (0.08330712057099286+0.04140761632657468j)
a'011000'b'010010' (0.008684166082412993-0.025700599551938038j)
a'011000'b'100010' (0.1150517269545685-0.04499380139846899j)
a'011000'b'001100' (-0.00407243180859539-0.02161735858258244j)
a'011000'b'010100' (-0.00302727302774198+0.02113814749816576j)
a'011000'b'100100' (-0.051262487430225254+0.03529016144462349j)
a'011000'b'011000' (0.05946537152570984+0.00884420515541066j)
a'011000'b'101000' (-0.062173528163228804+0.029463234453648273j)
a'011000'b'110000' (0.02673473313851004+0.036734957599347j)
a'101000'b'000011' (-0.015798890634857544+0.05293856367689234j)
a'101000'b'000101' (-0.005135208481873276+0.03810831003382732j)
a'101000'b'001001' (-0.01352719773468902-0.06480862017476745j)
a'101000'b'010001' (-0.005026984299682953-0.04583825282919821j)
a'101000'b'100001' (0.023243108298237156-0.059783963829031256j)
a'101000'b'000110' (0.1068184159294581-0.0249954307938098j)
a'101000'b'001010' (-0.01221061391886268-0.00013630349668720086j)
a'101000'b'010010' (0.014883567432258545-0.04725699855487568j)
a'101000'b'100010' (0.04187044100142279-0.043017820550722764j)
a'101000'b'001100' (0.0077014271287894585+0.03884128412022114j)
a'101000'b'010100' (0.005742857327183639+0.062428013716500974j)
a'101000'b'100100' (0.043543774281039595-0.008060208793273928j)
a'101000'b'011000' (0.053977247696189765-0.09329235916469403j)
a'101000'b'101000' (-0.022971008826838005+0.055632681391720666j)
a'101000'b'110000' (0.12816979703467796+0.015225067438518272j)
a'110000'b'000011' (-0.024386822038572755+0.014250147021199686j)
a'110000'b'000101' (-0.006487567988134044+0.07277158596867704j)
a'110000'b'001001' (0.04815270814804182-0.03337555646969429j)
a'110000'b'010001' (0.027821219545201347-0.030727547579185176j)
a'110000'b'100001' (0.08789560309404532-0.06443505521068914j)
a'110000'b'000110' (0.016078832281542006-0.10663851330658719j)
a'110000'b'001010' (0.03535446721894575-0.050700667385942914j)
a'110000'b'010010' (-0.02178085124563888-0.054153326158545276j)
a'110000'b'100010' (-0.0002599084820438533-0.01747207179857062j)
a'110000'b'001100' (0.04496413036802046+0.005729949648467694j)
a'110000'b'010100' (-0.05044318827465445-0.01627241216678231j)
a'110000'b'100100' (-0.002191826239082482-0.017225630107465185j)
a'110000'b'011000' (0.02160882544142758+0.05812412060175302j)
a'110000'b'101000' (-0.01049111861089695-0.032643020159676454j)
a'110000'b'110000' (0.0019625346558995466-0.043645829007408266j)
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.08209236002021322-0.04576669372332817j)
a'000011'b'000101' (0.06231605508381453+0.029284549868759394j)
a'000011'b'001001' (-0.005054320238764828+0.12961736729865067j)
a'000011'b'010001' (0.013524589258294225-0.014236741174618374j)
a'000011'b'100001' (0.051859879574508654+0.05213132353535454j)
a'000011'b'000110' (-0.05137143733810944+0.04348458792818929j)
a'000011'b'001010' (-0.022394757878697918-0.044158005109534056j)
a'000011'b'010010' (-0.013954641067604905-0.017051457522669435j)
a'000011'b'100010' (-0.07913610600689944+0.030976570302932157j)
a'000011'b'001100' (0.0689209086489859-0.017725352119037117j)
a'000011'b'010100' (-0.04221644283835465-0.031650580964178436j)
a'000011'b'100100' (-0.058915206498004295+0.07722495984043375j)
a'000011'b'011000' (-0.011834865871954193-0.03085229364310592j)
a'000011'b'101000' (0.07193359096429039+0.051597453458792304j)
a'000011'b'110000' (0.04865719882955984-0.08960588692918241j)
a'000101'b'000011' (-0.11479820302017646-0.10618474210798623j)
a'000101'b'000101' (-0.0814304016949147-0.01983993681652113j)
a'000101'b'001001' (-0.008015663911965744+0.13278558602995977j)
a'000101'b'010001' (0.012311153312854059-0.012412079620787754j)
a'000101'b'100001' (0.0118386181349055+0.017809279392718896j)
a'000101'b'000110' (-0.02607917142258407+0.02861285708509943j)
a'000101'b'001010' (-0.04012811374821017-0.026004815631117843j)
a'000101'b'010010' (0.04749726408811879+0.019865910268134522j)
a'000101'b'100010' (0.016880444829371257-0.06625543084087723j)
a'000101'b'001100' (-0.02404859741546726-0.009522449408896436j)
a'000101'b'010100' (-0.02444747499549893+0.01863577376409514j)
a'000101'b'100100' (-0.005470780378555608+0.03244121647696308j)
a'000101'b'011000' (-0.061193009926344584-0.07932718788162597j)
a'000101'b'101000' (-0.017622254632312626+0.05059260309942029j)
a'000101'b'110000' (0.05722171857652769-0.017234942828329523j)
a'001001'b'000011' (-0.019180638014521915-0.048536698837424834j)
a'001001'b'000101' (-0.07135746509539255+0.04506676323219153j)
a'001001'b'001001' (-0.04498386537696521-0.060619316497509936j)
a'001001'b'010001' (0.02288530608580442+0.031399460984722176j)
a'001001'b'100001' (0.01187384032822955+0.050274714517342896j)
a'001001'b'000110' (0.057787881223239614+0.035908334990199194j)
a'001001'b'001010' (-0.0392683039303247+0.0032455668413441776j)
a'001001'b'010010' (0.02405873021275316+0.011263821911785347j)
a'001001'b'100010' (-0.06501953497006395-0.06208101289473033j)
a'001001'b'001100' (0.02615277267435083-0.052911817752665874j)
a'001001'b'010100' (0.055462762509500024-0.009106669637607537j)
a'001001'b'100100' (-0.050905876160350354-0.03580846833492636j)
a'001001'b'011000' (0.025897062226205473-0.020486547288427574j)
a'001001'b'101000' (0.05219754422970324+0.05849788173151826j)
a'001001'b'110000' (-0.01751053203256405+0.0028147844017921927j)
a'010001'b'000011' (0.004496328537947831-0.04165438539105011j)
a'010001'b'000101' (-0.015019479991500752+0.02277239666511262j)
a'010001'b'001001' (0.03687222287206383-0.07487562618389079j)
a'010001'b'010001' (0.022040688699137723-0.0018856191277530987j)
a'010001'b'100001' (-0.024033323162404602+0.05042292073016075j)
a'010001'b'000110' (-0.008396547461079278+0.021833890806773j)
a'010001'b'001010' (0.03592360310844661+0.014222839230769814j)
a'010001'b'010010' (-0.0313105733934786-0.003526396481812536j)
a'010001'b'100010' (0.07272160936461193+0.03729404322805076j)
a'010001'b'001100' (-0.019225551271367318+0.020580945923777662j)
a'010001'b'010100' (0.0071584956068589676-0.012212740289145095j)
a'010001'b'100100' (-0.02936949791084008-0.004316915002711704j)
a'010001'b'011000' (-0.012199273651536675+0.03942014209292321j)
a'010001'b'101000' (-0.017917929417344262+0.01110157451593711j)
a'010001'b'110000' (-0.04755655758907736-0.04155254457769987j)
a'100001'b'000011' (-0.06047214107663689+0.04766906709576323j)
a'100001'b'000101' (0.02303744945938518+0.014116299843377646j)
a'100001'b'001001' (0.057694218071622345-0.025472433859279556j)
a'100001'b'010001' (0.037670786366928125-0.05147914612117844j)
a'100001'b'100001' (-0.02018461849276219-0.04680789892916425j)
a'100001'b'000110' (0.058843333745921565-0.015479657896384752j)
a'100001'b'001010' (-0.10884595418549475+0.05062364673995912j)
a'100001'b'010010' (0.03191479946872445-0.07859591545916603j)
a'100001'b'100010' (-0.002091762587248254-0.04830168593704451j)
a'100001'b'001100' (0.023051789132662207-0.03276879557799627j)
a'100001'b'010100' (0.002207922767327993-0.12176243492270998j)
a'100001'b'100100' (-0.004093953784326705+0.053589803699439026j)
a'100001'b'011000' (0.05094592359826702+0.04590239580123533j)
a'100001'b'101000' (-0.014431487537941023-0.024637717887622534j)
a'100001'b'110000' (-0.06068241724781274-0.034701232432404965j)
a'000110'b'000011' (0.07058881230866144-0.06838222793638662j)
a'000110'b'000101' (-0.0775191316356186+0.05428725696174918j)
a'000110'b'001001' (-0.00339224641744923+0.04969972745754802j)
a'000110'b'010001' (-0.028519253431140798-0.011311294399331484j)
a'000110'b'100001' (-0.05483849731438185+0.028438763827665418j)
a'000110'b'000110' (-0.020264098634968107+0.00837790147561478j)
a'000110'b'001010' (-0.048084626332563066-0.07326872417462772j)
a'000110'b'010010' (0.06438374180681906-0.05864496987455082j)
a'000110'b'100010' (0.052404955034712805-0.03195585806288442j)
a'000110'b'001100' (-0.010157763826696363+0.0002788377047558861j)
a'000110'b'010100' (-0.00662869616498068-0.10676274260338146j)
a'000110'b'100100' (0.04342956069343285-0.05191865280925437j)
a'000110'b'011000' (-0.08575969060840942-0.04987820393716232j)
a'000110'b'101000' (0.029591827421854802-0.009705502251959205j)
a'000110'b'110000' (-0.014117627603332484-0.01736964906526866j)
a'001010'b'000011' (-0.014592535644059322+0.06548082567952604j)
a'001010'b'000101' (-0.0013342219103572616+0.01798294274763997j)
a'001010'b'001001' (0.03996651819696439-0.11946307663961181j)
a'001010'b'010001' (-0.04753277235772432-0.0552949077116717j)
a'001010'b'100001' (0.0014767016529389776-0.03901368759028324j)
a'001010'b'000110' (-0.07462755742702522-0.08682349684665554j)
a'001010'b'001010' (-0.027771229051309562-0.037455125290848594j)
a'001010'b'010010' (0.038839512809274876-0.051958580141384554j)
a'001010'b'100010' (-0.0034469294983146197-0.056091730050915174j)
a'001010'b'001100' (0.05538123765271634+0.011309762562619508j)
a'001010'b'010100' (-0.010712308012282743+0.037008794650949965j)
a'001010'b'100100' (-0.04093466633007682+0.04882110578525808j)
a'001010'b'011000' (0.006706016488941424+0.09722386706386633j)
a'001010'b'101000' (0.07254269449097864+0.0016180417712452072j)
a'001010'b'110000' (0.09649686734474837+0.026248429990929925j)
a'010010'b'000011' (0.028249975265045368-0.022861889130323613j)
a'010010'b'000101' (-0.03412565439327374+0.010156909513193174j)
a'010010'b'001001' (-0.0418488905440871-0.020305485058635657j)
a'010010'b'010001' (-0.010093298081341722+0.09731259141054725j)
a'010010'b'100001' (-0.019956199446858506-0.014675838918865806j)
a'010010'b'000110' (0.011796410123479508+0.13275639334330197j)
a'010010'b'001010' (0.0009901784723968664+0.018186726489414738j)
a'010010'b'010010' (-0.0037862990864662442+0.01669809304974978j)
a'010010'b'100010' (0.0033092490786873906-0.06029136937643842j)
a'010010'b'001100' (0.028544100488016252-0.006610322902986797j)
a'010010'b'010100' (0.05839015125264924-0.008772876927110996j)
a'010010'b'100100' (-0.03352672579998074-0.013631945809841721j)
a'010010'b'011000' (0.03059941807366773-0.08063390070393303j)
a'010010'b'101000' (0.014318876575799331-0.0787264182261708j)
a'010010'b'110000' (-0.09909096632983222-0.005736184147661819j)
a'100010'b'000011' (-0.022783987880193594-0.01937818674391765j)
a'100010'b'000101' (-0.011261001269421202-0.0008032777459828031j)
a'100010'b'001001' (-0.012831887270124768+0.021772591583131055j)
a'100010'b'010001' (0.01681504964808714-0.021785937952548j)
a'100010'b'100001' (0.016199473389426795+0.00888309452393046j)
a'100010'b'000110' (-0.08757773509259639-0.05190858899559672j)
a'100010'b'001010' (0.04562111708570952+0.04001582336177208j)
a'100010'b'010010' (0.019278248977771643+0.021769042411312726j)
a'100010'b'100010' (-0.09191251595075854-0.009361839623864518j)
a'100010'b'001100' (0.02210953410992187-0.005988942246347638j)
a'100010'b'010100' (0.021409816198604676+0.04510287784757864j)
a'100010'b'100100' (0.11167376853667106+0.026645188373139336j)
a'100010'b'011000' (-0.036369074434857714-0.0688553808156075j)
a'100010'b'101000' (0.024252756352454937-0.03576062044020178j)
a'100010'b'110000' (0.023855702845177816-0.10149538025715804j)
a'001100'b'000011' (-0.0034006550006444453-0.08484803334236292j)
a'001100'b'000101' (-0.09525397259743619+0.010314482830500956j)
a'001100'b'001001' (0.056639349258507894-0.07366575796865682j)
a'001100'b'010001' (0.018406694180877627+0.02918456664641173j)
a'001100'b'100001' (-0.07669339391966924-0.08416617535613076j)
a'001100'b'000110' (0.03543840765930766+0.09174916471647758j)
a'001100'b'001010' (-0.043887044830011594+0.05624662481363551j)
a'001100'b'010010' (-0.004384899501867533+0.05311644103616933j)
a'001100'b'100010' (-0.06094565731901713-0.03139709698672588j)
a'001100'b'001100' (-0.062032164256553085+0.028563485319760436j)
a'001100'b'010100' (0.0005594744020103164-0.051496388243233j)
a'001100'b'100100' (0.033975234319962064-0.03504503493041362j)
a'001100'b'011000' (-0.07200558484171114-0.09762187014248756j)
a'001100'b'101000' (-0.006992920160314318-0.0476858953326632j)
a'001100'b'110000' (-0.060834991814268075+0.05373664535469358j)
a'010100'b'000011' (0.045250858601382525-0.05574591221345305j)
a'010100'b'000101' (0.024576795043204265+0.03427949242065909j)
a'010100'b'001001' (-0.026458720431203064+0.06801706971532782j)
a'010100'b'010001' (-0.009497817474703643+0.013647395459015898j)
a'010100'b'100001' (-0.0361814585769482+0.02461075369795522j)
a'010100'b'000110' (-0.03825980386174521+0.004694757157455315j)
a'010100'b'001010' (-0.016603861268971173-0.06164645107389676j)
a'010100'b'010010' (-0.002537852839414677+0.08192191686207485j)
a'010100'b'100010' (0.01598810854273302-0.01664543786997091j)
a'010100'b'001100' (0.018070076030850483+0.04314460767635585j)
a'010100'b'010100' (0.06822257702422764-0.03272962611914405j)
a'010100'b'100100' (0.03726988631464119-0.03770407779777652j)
a'010100'b'011000' (-0.0627658232408941-0.0157963794663818j)
a'010100'b'101000' (-0.007329234878707198+0.008577795153780474j)
a'010100'b'110000' (0.008714055985612354+0.012928590462684526j)
a'100100'b'000011' (0.002794985456298548-0.006598729353206326j)
a'100100'b'000101' (-0.04743406855256619+0.022846771696997774j)
a'100100'b'001001' (-0.04627359851936249-0.07545456502215142j)
a'100100'b'010001' (0.06822094145689105-0.027615937349042222j)
a'100100'b'100001' (0.026764589481613258-0.007301330671706657j)
a'100100'b'000110' (-0.018973003465039183+0.03695546750136798j)
a'100100'b'001010' (0.0825804973991067+0.06840463430512013j)
a'100100'b'010010' (0.06700144769690818-0.04837311469436156j)
a'100100'b'100010' (-0.04322582688959842-0.04623553295740971j)
a'100100'b'001100' (-0.0711733426200731-0.08027577634809079j)
a'100100'b'010100' (0.010005179171365083+0.008038402630894333j)
a'100100'b'100100' (0.044713109238636806-0.032662637404345995j)
a'100100'b'011000' (0.10307067775584965-0.029150920304203572j)
a'100100'b'101000' (-0.004484476474856764+0.02404571917680625j)
a'100100'b'110000' (0.014849663263264402-0.05602005057309934j)
a'011000'b'000011' (0.0008426755265673388-0.01369164198862961j)
a'011000'b'000101' (-0.0629518593793846-0.03971082284992044j)
a'011000'b'001001' (-0.0026393436316034464+0.029694561449259346j)
a'011000'b'010001' (-0.002129588308379028+0.02383590770094342j)
a'011000'b'100001' (0.03114761871166399+0.055511183029689895j)
a'011000'b'000110' (-0.021622220174452925-0.05341647299296536j)
a'011000'b'001010' (0.0833071205709928+0.041407616326574845j)
a'011000'b'010010' (0.008684166082413002-0.025700599551938038j)
a'011000'b'100010' (0.11505172695456854-0.044993801398469056j)
a'011000'b'001100' (-0.004072431808595388-0.02161735858258244j)
a'011000'b'010100' (-0.003027273027741998+0.021138147498165744j)
a'011000'b'100100' (-0.05126248743022522+0.0352901614446235j)
a'011000'b'011000' (0.05946537152570985+0.008844205155410763j)
a'011000'b'101000' (-0.062173528163228846+0.02946323445364822j)
a'011000'b'110000' (0.026734733138510006+0.03673495759934703j)
a'101000'b'000011' (-0.01579889063485748+0.05293856367689234j)
a'101000'b'000101' (-0.0051352084818732675+0.038108310033827315j)
a'101000'b'001001' (-0.013527197734689354-0.06480862017476732j)
a'101000'b'010001' (-0.005026984299682914-0.04583825282919821j)
a'101000'b'100001' (0.023243108298237277-0.0597839638290312j)
a'101000'b'000110' (0.10681841592945808-0.024995430793809777j)
a'101000'b'001010' (-0.012210613918862686-0.0001363034966872j)
a'101000'b'010010' (0.014883567432258547-0.047256998554875675j)
a'101000'b'100010' (0.04187044100142279-0.04301782055072278j)
a'101000'b'001100' (0.007701427128789393+0.038841284120221156j)
a'101000'b'010100' (0.005742857327183588+0.06242801371650098j)
a'101000'b'100100' (0.04354377428103961-0.008060208793273849j)
a'101000'b'011000' (0.05397724769618984-0.09329235916469399j)
a'101000'b'101000' (-0.022971008826838106+0.055632681391720624j)
a'101000'b'110000' (0.12816979703467798+0.015225067438518376j)
a'110000'b'000011' (-0.024386822038572738+0.01425014702119967j)
a'110000'b'000101' (-0.006487567988134071+0.07277158596867705j)
a'110000'b'001001' (0.04815270814804181-0.033375556469694305j)
a'110000'b'010001' (0.02782121954520138-0.030727547579185163j)
a'110000'b'100001' (0.08789560309404534-0.06443505521068914j)
a'110000'b'000110' (0.016078832281542003-0.10663851330658723j)
a'110000'b'001010' (0.035354467218945744-0.05070066738594292j)
a'110000'b'010010' (-0.021780851245638888-0.05415332615854529j)
a'110000'b'100010' (-0.0002599084820438498-0.017472071798570625j)
a'110000'b'001100' (0.04496413036802046+0.0057299496484676925j)
a'110000'b'010100' (-0.050443188274654445-0.016272412166782317j)
a'110000'b'100100' (-0.0021918262390824878-0.017225630107465188j)
a'110000'b'011000' (0.02160882544142752+0.058124120601753j)
a'110000'b'101000' (-0.010491118610896919-0.03264302015967646j)
a'110000'b'110000' (0.0019625346558995857-0.043645829007408245j)
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