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.9870409869369888+0.16046834611989685j)

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.0059692303566208004-0.028398657308747452j)
a'000011'b'000101' (-0.039512173581870695+0.01701795806687059j)
a'000011'b'001001' (0.03845542262292439-0.038026707275150416j)
a'000011'b'010001' (0.022164075682562942+0.013523839960928112j)
a'000011'b'100001' (-0.004675938305359342+0.09329716999452839j)
a'000011'b'000110' (-0.0374012687640091+0.02520681958738527j)
a'000011'b'001010' (0.019521139610251256+0.04968067339602323j)
a'000011'b'010010' (0.0991784806405013-0.004367297583736528j)
a'000011'b'100010' (0.007192695901838686+0.009703460363102984j)
a'000011'b'001100' (-0.013216671625451131+0.006512875438970328j)
a'000011'b'010100' (0.03708491655680964-0.026575571041964893j)
a'000011'b'100100' (-0.030060446670603282-0.012651206801780465j)
a'000011'b'011000' (-0.009450224669326797-0.05770552586177642j)
a'000011'b'101000' (0.009175738289232594-0.04077117114669291j)
a'000011'b'110000' (-0.005814617997613454-0.05795794403061433j)
a'000101'b'000011' (-0.005611877504080999-0.07515977904904518j)
a'000101'b'000101' (0.07896487676041951+0.020042619950303524j)
a'000101'b'001001' (-0.02229197070352942+9.890888676679661e-05j)
a'000101'b'010001' (0.015460606207543609+0.019665137213183612j)
a'000101'b'100001' (-0.020239975175983183-0.06736594801683364j)
a'000101'b'000110' (-0.03474639153797463+0.004989074334323147j)
a'000101'b'001010' (-0.06841547412970925-0.03411285831131446j)
a'000101'b'010010' (0.032554004281802065+0.02845596627789372j)
a'000101'b'100010' (0.0598288571655583+0.015410511513126054j)
a'000101'b'001100' (0.022324993209824912-0.071439544736213j)
a'000101'b'010100' (-0.03130410484362679-3.565595400635683e-05j)
a'000101'b'100100' (0.05675529437240588-0.011217300675013156j)
a'000101'b'011000' (0.0452603980885472+0.047169087126775616j)
a'000101'b'101000' (-0.045400435806593135-0.08543739707852459j)
a'000101'b'110000' (0.06175371717162485+0.029365053193889417j)
a'001001'b'000011' (-0.009353383609341143-0.011878244185078286j)
a'001001'b'000101' (-0.039945351828145424+0.05664572783103645j)
a'001001'b'001001' (0.02110342275571698-0.08647310975657253j)
a'001001'b'010001' (0.03062644798847305+0.02151800524091509j)
a'001001'b'100001' (0.03906798261534691+0.0030778171574784813j)
a'001001'b'000110' (0.013563496665157698-0.028377177415655274j)
a'001001'b'001010' (-0.029901818073470452+0.026827044554303448j)
a'001001'b'010010' (0.08435768567050128+0.17149429419726997j)
a'001001'b'100010' (0.0739963156965625+0.053271871184029984j)
a'001001'b'001100' (-0.07435104154492048+0.021549847375894923j)
a'001001'b'010100' (0.057300782305781096-0.05101455708543458j)
a'001001'b'100100' (0.1042891240982101-0.002027290617439396j)
a'001001'b'011000' (0.06830112035702846+0.11505088083186009j)
a'001001'b'101000' (-0.06349538010343392-0.029090780511890704j)
a'001001'b'110000' (-0.04712465438011051-0.057674638044346103j)
a'010001'b'000011' (-0.032108081299691234-0.08886404844063048j)
a'010001'b'000101' (-0.05346222065862725+0.094677931137734j)
a'010001'b'001001' (0.06370541192317604-0.04040594891449364j)
a'010001'b'010001' (0.04280144790134607+0.07686504428863333j)
a'010001'b'100001' (-0.013397232232840117-0.07608890240938274j)
a'010001'b'000110' (0.013408531047834089+0.009641100348395248j)
a'010001'b'001010' (-0.0015871355879163158+0.06971521345825595j)
a'010001'b'010010' (0.0014512271084466523+0.046119787259088246j)
a'010001'b'100010' (-0.03721628033738327-0.03743398055687987j)
a'010001'b'001100' (0.01146656058852233-0.007637609009065024j)
a'010001'b'010100' (0.07784609371288859-0.05754148503680316j)
a'010001'b'100100' (-0.07162661831422673-0.01606824970715518j)
a'010001'b'011000' (0.03015669691713215+0.076797000667415j)
a'010001'b'101000' (0.003287789804961207-0.001547487968205279j)
a'010001'b'110000' (-0.03413376245821122+0.01665421978895424j)
a'100001'b'000011' (-0.04463036181186851-0.03419128736879212j)
a'100001'b'000101' (0.03276084252477456+0.010141158381706344j)
a'100001'b'001001' (-0.01979642095929206+0.015818965529465136j)
a'100001'b'010001' (-0.028781237363059903+0.013818246959582673j)
a'100001'b'100001' (0.007381630698418642-0.005591043862049161j)
a'100001'b'000110' (0.041775222825596287-0.013848403211604392j)
a'100001'b'001010' (0.021379983031225888+0.0007848345477987299j)
a'100001'b'010010' (0.055264138999297954-0.008540703981659072j)
a'100001'b'100010' (-0.015518763171490186+0.010126628177566231j)
a'100001'b'001100' (-0.007132537159842278+0.039073131368863825j)
a'100001'b'010100' (-0.031008738524480158+0.04037887678244856j)
a'100001'b'100100' (-0.02891092179013225+0.03816688126950392j)
a'100001'b'011000' (-0.022972665359437414-0.023124512466497157j)
a'100001'b'101000' (-0.06446805522362391+0.010169559847096488j)
a'100001'b'110000' (-0.026109168141969532-0.04630026816297165j)
a'000110'b'000011' (-0.003143431864242543-5.6978593278409644e-05j)
a'000110'b'000101' (0.014403248449284834-0.06615168071111638j)
a'000110'b'001001' (0.012763057820996626+0.024790558677266764j)
a'000110'b'010001' (0.0419964975969245-0.10582052232379804j)
a'000110'b'100001' (0.08337329724411689+0.040104980867594446j)
a'000110'b'000110' (0.0021947209295719683+0.04780505594593157j)
a'000110'b'001010' (0.030129976214039334-0.0073787286442729j)
a'000110'b'010010' (-0.03461585856036916+0.008508524178848802j)
a'000110'b'100010' (-0.04142532185053254+0.040262105975403216j)
a'000110'b'001100' (0.0027039559669674363-0.004193106368680472j)
a'000110'b'010100' (-0.030813009916080075+0.003952342466262531j)
a'000110'b'100100' (-0.012019986234744708+0.00889266311057641j)
a'000110'b'011000' (0.005297561092532449-0.1304756814613414j)
a'000110'b'101000' (-0.020458271645629147-0.13257152943160896j)
a'000110'b'110000' (-0.05242626267096586-0.02940273874708099j)
a'001010'b'000011' (-0.03138669660678724-0.03855085825579984j)
a'001010'b'000101' (0.03958399607722077-0.03654969874842652j)
a'001010'b'001001' (-0.021965737099609417+0.061544689557587726j)
a'001010'b'010001' (-0.0234640463890853-0.05717793054268311j)
a'001010'b'100001' (0.017637833111708627+0.0011064537794681392j)
a'001010'b'000110' (0.014076887124653598+0.003527247373465501j)
a'001010'b'001010' (-0.05665497476934133+0.041772279252316934j)
a'001010'b'010010' (0.011136043294020341+0.06405179602060938j)
a'001010'b'100010' (0.07099169678014017+0.1085966417477429j)
a'001010'b'001100' (-0.03983951327547103+0.054681906421823086j)
a'001010'b'010100' (0.05184686279635146-0.04890579888506299j)
a'001010'b'100100' (-0.0547284936727346+0.013284265604680372j)
a'001010'b'011000' (0.01657686493729768+0.02660502121049557j)
a'001010'b'101000' (0.08439323914509483+0.0854692434151423j)
a'001010'b'110000' (0.030634422782817552+0.039840540423329664j)
a'010010'b'000011' (0.033295030828504775-0.025175597476341714j)
a'010010'b'000101' (0.05463054153950338-0.030504615833952167j)
a'010010'b'001001' (0.0019030185752975685+0.0031326658417561142j)
a'010010'b'010001' (0.03143606305519327-0.013107045683472271j)
a'010010'b'100001' (0.03895852364064507+0.03557484131903349j)
a'010010'b'000110' (0.0454843305382579-0.019532536903326878j)
a'010010'b'001010' (-0.016234482613808228+0.0018680397265279053j)
a'010010'b'010010' (-0.04841037483713336+0.012440693448993932j)
a'010010'b'100010' (0.0029459284232994276-0.033560462782164104j)
a'010010'b'001100' (-0.06007777737912047+0.005622357899191912j)
a'010010'b'010100' (0.020868367947671836-0.02346680518797593j)
a'010010'b'100100' (-0.03746801969160629-0.044452835906097464j)
a'010010'b'011000' (-0.02036970866682371-0.05803854839829473j)
a'010010'b'101000' (-0.017918714172443694+0.00858525332507514j)
a'010010'b'110000' (0.03109824561493231+0.02733447915152858j)
a'100010'b'000011' (0.0123521436518888+0.007939584290244517j)
a'100010'b'000101' (-0.024323138080891954+0.015490633567176254j)
a'100010'b'001001' (0.04438111713072363+0.02309071613910228j)
a'100010'b'010001' (-0.031032989260187757+0.007385876962364989j)
a'100010'b'100001' (0.004550475890629814-0.08520684046029531j)
a'100010'b'000110' (0.009198381436132483-0.007626595506498053j)
a'100010'b'001010' (-0.06823686203777757-0.010595133776325948j)
a'100010'b'010010' (0.04376748051316233-0.008312661695110031j)
a'100010'b'100010' (0.026355566657663948+0.000896244102710666j)
a'100010'b'001100' (0.021067526709463033-0.12395704269140871j)
a'100010'b'010100' (0.03525641181799579-0.0652504539413426j)
a'100010'b'100100' (0.0068675429016236255+0.031961910855898196j)
a'100010'b'011000' (-0.0598522302468331+0.12156879527279256j)
a'100010'b'101000' (-0.011009767101531374-0.025387495309570535j)
a'100010'b'110000' (0.052420191505782476+0.0517324918439839j)
a'001100'b'000011' (-0.05108020302215197-0.11822194319493924j)
a'001100'b'000101' (-0.019649287372596306-0.05722941172096268j)
a'001100'b'001001' (0.0910192759071139+0.0037328493094391903j)
a'001100'b'010001' (-0.06355146895192068+0.0016095231347152703j)
a'001100'b'100001' (0.07601356054131664+0.02627564027167832j)
a'001100'b'000110' (-0.017002981873502406+0.013756022410968715j)
a'001100'b'001010' (-0.023976107069765076-0.06080036406766831j)
a'001100'b'010010' (-0.056946435697319775+0.059177639562584254j)
a'001100'b'100010' (-0.050368537544563205+0.05013858206087831j)
a'001100'b'001100' (0.07705752542313883-0.06440675951398897j)
a'001100'b'010100' (0.05368816704248061-0.017260501921614695j)
a'001100'b'100100' (-0.03954551518367701+0.014648597843053767j)
a'001100'b'011000' (-0.013544551789157932+0.005661577434842891j)
a'001100'b'101000' (-0.0029136619222377685-0.007360538105564307j)
a'001100'b'110000' (-0.014720951205427064+0.0657648904793333j)
a'010100'b'000011' (0.06777593029796238-0.007550845149041949j)
a'010100'b'000101' (0.0015431946160159341-0.058013267579912216j)
a'010100'b'001001' (-0.0031956585370043105-0.01872647752432777j)
a'010100'b'010001' (0.05668222118467067-0.006014971703376014j)
a'010100'b'100001' (-0.014919842454785478-0.06639620828736363j)
a'010100'b'000110' (-0.01306728189877607+0.02227790432995733j)
a'010100'b'001010' (-0.03152802529170045-0.009413595487187803j)
a'010100'b'010010' (-0.03490680532983525-0.00864419440190866j)
a'010100'b'100010' (-0.018848875046128234-0.044189809448476156j)
a'010100'b'001100' (0.06849102170391078-0.08763561988351462j)
a'010100'b'010100' (0.00594587864808287-0.09409883430323204j)
a'010100'b'100100' (-0.13160822584875376-0.013060735193096865j)
a'010100'b'011000' (-0.02284996053249512-0.043721647370189014j)
a'010100'b'101000' (-0.05443704828020708-0.02329075728329125j)
a'010100'b'110000' (0.03525641502424447-0.09428871562099186j)
a'100100'b'000011' (-0.031506527081546325+0.043279920280126304j)
a'100100'b'000101' (0.02691199041745539+0.004618164917457191j)
a'100100'b'001001' (-0.04545535748365663+0.014190355769815128j)
a'100100'b'010001' (-0.05332810205739431-0.04885641018814852j)
a'100100'b'100001' (0.006533181492069882+0.020580369765031446j)
a'100100'b'000110' (-0.019453178291741098-0.021905807768132224j)
a'100100'b'001010' (0.10420244113929325-0.01709710256648317j)
a'100100'b'010010' (-0.027098502506778824+0.07610565296058164j)
a'100100'b'100010' (-0.044995084113714744+0.042181296178543j)
a'100100'b'001100' (-0.03980846983515254-0.036453666203769074j)
a'100100'b'010100' (0.10381624127898822-0.10178773585388853j)
a'100100'b'100100' (-0.10681287425140863+0.03398272769354482j)
a'100100'b'011000' (-0.02882238180071978+0.06970055382722797j)
a'100100'b'101000' (-0.020178320431757216-0.11148090215708698j)
a'100100'b'110000' (-0.036968879940063-0.058392519437561755j)
a'011000'b'000011' (-0.01491428376371052+0.0038432834574368625j)
a'011000'b'000101' (0.027115477198006555+0.026021362127958393j)
a'011000'b'001001' (0.060409685337956515-0.052290033815163374j)
a'011000'b'010001' (0.0607367637407677-0.04788042229819744j)
a'011000'b'100001' (0.03236352043998571+0.02377055374346314j)
a'011000'b'000110' (0.02932746973143364+0.031044650724948206j)
a'011000'b'001010' (0.06418954102329986-0.06666941850478253j)
a'011000'b'010010' (0.03424592588960442+0.011136884912860478j)
a'011000'b'100010' (0.016720551357271074+0.07638266369135349j)
a'011000'b'001100' (-0.016269303334719206+0.031872484853861745j)
a'011000'b'010100' (-0.048537208617315517+0.05111907121413584j)
a'011000'b'100100' (-0.06968900610222047+0.04119703413184967j)
a'011000'b'011000' (0.004097707407106102-0.057160377185310446j)
a'011000'b'101000' (0.009675556121326524+0.016170672021785917j)
a'011000'b'110000' (0.022256721945904067-0.0010649855648847725j)
a'101000'b'000011' (-0.05459169615106567-0.056904213445942625j)
a'101000'b'000101' (-0.03943449334683318-0.003385329290027214j)
a'101000'b'001001' (-0.03213088738370981-0.05232622547889854j)
a'101000'b'010001' (0.024247232288297754-0.053610628822761124j)
a'101000'b'100001' (0.0476401959397676-0.02877639042852904j)
a'101000'b'000110' (-0.09457506858278197+0.01431550006957483j)
a'101000'b'001010' (-0.05395917469643207+0.001008885840792552j)
a'101000'b'010010' (0.04644002339727731-0.015858037677576483j)
a'101000'b'100010' (0.05439240291675636-0.05854211902726603j)
a'101000'b'001100' (0.046839011146548336+0.05897295147675351j)
a'101000'b'010100' (0.07357366105998553-0.019681223269861037j)
a'101000'b'100100' (0.04484547842989464+0.011051852502542961j)
a'101000'b'011000' (0.05581672183496987+0.040606963228178104j)
a'101000'b'101000' (0.06953330412768279-0.005377718983374635j)
a'101000'b'110000' (0.08548862606077874-0.06366641815156872j)
a'110000'b'000011' (0.01661089581861554-0.020601863486223237j)
a'110000'b'000101' (-0.04690815656896847+0.08412911544497027j)
a'110000'b'001001' (-0.010455385778248545-0.016387428540293014j)
a'110000'b'010001' (-0.004101897022238049-0.08269547260500604j)
a'110000'b'100001' (-0.015600356983893554+0.06559523268394353j)
a'110000'b'000110' (0.056747275141145484+0.10173447121663337j)
a'110000'b'001010' (0.04214471773914416+0.012504851311949148j)
a'110000'b'010010' (0.02296281933605609+0.037682339297424296j)
a'110000'b'100010' (0.10128801512308445+0.006738439097075111j)
a'110000'b'001100' (0.012619881929253073-0.03358742979340074j)
a'110000'b'010100' (0.0004527019032424084+0.11900036808114736j)
a'110000'b'100100' (0.039777344871455594-0.007764401906930268j)
a'110000'b'011000' (-0.005824058804897906+0.020544154080993603j)
a'110000'b'101000' (0.014149421258639992+0.018613877927525932j)
a'110000'b'110000' (-0.01841949034950602-0.07181910309238866j)

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.02445676580705044-0.015619924911764692j)
a'000011'b'000101' (0.028018099166678207+0.03264672842745247j)
a'000011'b'001001' (-0.05399748499539621+0.003020200236683932j)
a'000011'b'010001' (-0.02474363678579513-0.007867206414212133j)
a'000011'b'100001' (-0.04677215295170172-0.08086156093154567j)
a'000011'b'000110' (-0.04508338480317351+0.0013141817064688777j)
a'000011'b'001010' (-0.05290702253295303-0.00707751138910098j)
a'000011'b'010010' (0.028152078930614267-0.0951992897149326j)
a'000011'b'100010' (-0.004863756484536653+0.011056034108746468j)
a'000011'b'001100' (0.003842626907698079-0.01422435143641997j)
a'000011'b'010100' (0.022344616943923815+0.03977775893462791j)
a'000011'b'100100' (0.03260203056581747+0.0008894327198292375j)
a'000011'b'011000' (0.0577309988900798+0.009293343232578313j)
a'000011'b'101000' (-0.0130797920244022-0.03969132915919796j)
a'000011'b'110000' (0.03457541280090836+0.04687722142321124j)
a'000101'b'000011' (-0.070073717458666+0.0277517508879197j)
a'000101'b'000101' (0.03275475824646413+0.0745941297186061j)
a'000101'b'001001' (-0.01797411750475861+0.013186085118033536j)
a'000101'b'010001' (-0.010813571371841982+0.022556920004826782j)
a'000101'b'100001' (-0.04611058107471281-0.05311912894883993j)
a'000101'b'000110' (0.0020154081690716944-0.03504483867184548j)
a'000101'b'001010' (0.07080742817884221-0.02882138645622094j)
a'000101'b'010010' (-0.0318571274371608+0.029234032274742895j)
a'000101'b'100010' (-0.061344850797472754+0.00733384588526193j)
a'000101'b'001100' (-0.0020887111823741163-0.07481745223898453j)
a'000101'b'010100' (0.006021259586854643-0.0307195814488991j)
a'000101'b'100100' (0.006628795696162439+0.057472170146520785j)
a'000101'b'011000' (-0.014123496945868739+0.06382752736497911j)
a'000101'b'101000' (-0.00013465854879960755+0.09675086696282002j)
a'000101'b'110000' (-0.05994260193486933-0.03290459552814452j)
a'001001'b'000011' (-0.0008595625045246908+0.015094357295514536j)
a'001001'b'000101' (0.0009912948302237888+0.06930647118950545j)
a'001001'b'001001' (0.014978919817421629+0.08774158149977694j)
a'001001'b'010001' (0.03715676767555076-0.004514253187830737j)
a'001001'b'100001' (0.03299388364912935+0.021146722342614496j)
a'001001'b'000110' (0.012341428016631835+0.028929600660493302j)
a'001001'b'001010' (-0.030769313805422648-0.025827473193499494j)
a'001001'b'010010' (-0.18937471460792674+0.025762948997915962j)
a'001001'b'100010' (0.09085394763732602+0.007675102268194664j)
a'001001'b'001100' (0.06052723842233882+0.048258954710024636j)
a'001001'b'010100' (0.07423677475759707+0.019358872928643852j)
a'001001'b'100100' (-0.09297968298580851-0.04727694855083153j)
a'001001'b'011000' (0.13234048183091357-0.019691244017933433j)
a'001001'b'101000' (0.0038811564051725415+0.06973430597796997j)
a'001001'b'110000' (-0.06437103417714114+0.037462873394289053j)
a'010001'b'000011' (0.05231277778376421+0.07868367855249783j)
a'010001'b'000101' (-0.10855586580863756-0.00614358859383725j)
a'010001'b'001001' (0.02028172465530158-0.07266135053099922j)
a'010001'b'010001' (-0.06436746696915317-0.05997522965291735j)
a'010001'b'100001' (-0.03477160521058292-0.06899233560653371j)
a'010001'b'000110' (-0.011054554055743251+0.012269325793099157j)
a'010001'b'001010' (-0.06563146795042676-0.023563539665693873j)
a'010001'b'010010' (-0.0032961073318400346-0.04602473805901387j)
a'010001'b'100010' (0.051108126294559235+0.013202797019682704j)
a'010001'b'001100' (0.012716840729694454+0.005300664577313785j)
a'010001'b'010100' (-0.042267889085392155-0.08708881879358261j)
a'010001'b'100100' (0.07057163580757868+0.020204091645651723j)
a'010001'b'011000' (0.02366496578959261-0.07903907308818925j)
a'010001'b'101000' (-0.0010108965423243908-0.0034903250556450388j)
a'010001'b'110000' (-0.033725478346511704+0.017466221303743826j)
a'100001'b'000011' (0.05604555867851421+0.004450694306154128j)
a'100001'b'000101' (0.03403620183282699-0.004201530798529691j)
a'100001'b'001001' (-0.024918103578060985+0.0046071756307880995j)
a'100001'b'010001' (-0.023573271328145327+0.021531475845246936j)
a'100001'b'100001' (0.006434145838288024-0.006659580359664927j)
a'100001'b'000110' (-0.03391001927673214+0.02805455589188769j)
a'100001'b'001010' (0.018744434094721096-0.010313381121222214j)
a'100001'b'010010' (-0.043169459236775544+0.03554527356823164j)
a'100001'b'100010' (-0.001476198866398358+0.01847163895073533j)
a'100001'b'001100' (0.02467692162011865-0.031122856884603978j)
a'100001'b'010100' (0.03330317704013882-0.03850836213246306j)
a'100001'b'100100' (0.036682839479275225+0.030772089827200224j)
a'100001'b'011000' (-0.02645109048179078+0.019047998394949407j)
a'100001'b'101000' (0.060427353809017745-0.024659379623982538j)
a'100001'b'110000' (-0.028245440760635166-0.04502886373501082j)
a'000110'b'000011' (-0.0026263185636759075-0.001728253814495618j)
a'000110'b'000101' (0.061970019009053565+0.02726197298096481j)
a'000110'b'001001' (-0.027041939171802667-0.006797129563399115j)
a'000110'b'010001' (0.10057170254686812+0.053357486842187496j)
a'000110'b'100001' (-0.09224157475661716-0.007141993430786286j)
a'000110'b'000110' (-0.0478128280410435-0.0020183281868797606j)
a'000110'b'001010' (-0.02030105943782988-0.02345480950180769j)
a'000110'b'010010' (-0.018263589286203332-0.03061199036257552j)
a'000110'b'100010' (0.027384742868545274+0.05086423425176543j)
a'000110'b'001100' (0.0028733834842722965-0.004078870706786224j)
a'000110'b'010100' (-0.029223259204856557+0.010538676980761797j)
a'000110'b'100100' (0.001308599999163887-0.014894532296243719j)
a'000110'b'011000' (0.11637413628924524-0.05923704929571293j)
a'000110'b'101000' (-0.013654633968013809-0.13344400423309355j)
a'000110'b'110000' (0.036478175380960993+0.047774227197831885j)
a'001010'b'000011' (0.04894470772039069-0.008701090869012365j)
a'001010'b'000101' (0.001285680717770669+0.05386204831914689j)
a'001010'b'001001' (-0.06402402787428334-0.013083052924375081j)
a'001010'b'010001' (0.06166449141002132-0.004167458846401555j)
a'001010'b'100001' (0.015699449334237597-0.008114473947477505j)
a'001010'b'000110' (-0.003276790022888273-0.014137286596081926j)
a'001010'b'001010' (-0.0061202629323821875+0.07012311930944577j)
a'001010'b'010010' (0.014866871545096555-0.06328996890640451j)
a'001010'b'100010' (0.00226864018648116-0.12972241472588797j)
a'001010'b'001100' (-0.05186887500717805+0.043438663808192744j)
a'001010'b'010100' (0.0680229902821914+0.021277855612791906j)
a'001010'b'100100' (-0.05533601565365062+0.01046924562330926j)
a'001010'b'011000' (-0.0120768072680193+0.028926982749181537j)
a'001010'b'101000' (-0.11259721488081886-0.04182197489885823j)
a'001010'b'110000' (-0.016745974268279985+0.04738469020966035j)
a'010010'b'000011' (-0.01296749215205898-0.03967636492230805j)
a'010010'b'000101' (0.024324138829221267+0.05764862466957197j)
a'010010'b'001001' (-0.003573843533231464+0.000814074550648026j)
a'010010'b'010001' (-0.03088623239817171+0.014354837345119746j)
a'010010'b'100001' (-0.05165778776977985-0.010714889727173825j)
a'010010'b'000110' (0.03198497885829104+0.03777969626436932j)
a'010010'b'001010' (0.015667185718965186+0.0046462124150087715j)
a'010010'b'010010' (0.027284717473827606-0.04187934380738317j)
a'010010'b'100010' (-0.03353921432491071+0.0031787196944571923j)
a'010010'b'001100' (-0.03430596412048562-0.04963920898771172j)
a'010010'b'010100' (-0.006413896595937394+0.03074152984134743j)
a'010010'b'100100' (0.01677981926611456+0.05566277737502465j)
a'010010'b'011000' (-0.006723079937106397+0.06114080738354502j)
a'010010'b'101000' (-0.016955587133395577-0.010358327915801801j)
a'010010'b'110000' (0.030248247912357733+0.02827221478845535j)
a'100010'b'000011' (-0.0007748836270772933+0.014663287723538735j)
a'100010'b'000101' (0.017050294711608027-0.0232564447984204j)
a'100010'b'001001' (0.049938748150273535-0.0029976929080809j)
a'100010'b'010001' (0.022919757601873307-0.0221874359130904j)
a'100010'b'100001' (-0.06463949582446145-0.055701418937194457j)
a'100010'b'000110' (-0.004817380421614869-0.010934716545835318j)
a'100010'b'001010' (0.05050232431986007+0.0470960872981249j)
a'100010'b'010010' (-0.016099191921772282-0.0415392430647615j)
a'100010'b'100010' (-0.022755457162568403-0.01332697702634492j)
a'100010'b'001100' (0.027376511074600075-0.12271803353963899j)
a'100010'b'010100' (-0.058231463316574736+0.04593182985514293j)
a'100010'b'100100' (-0.03094768092145728+0.01053413198368488j)
a'100010'b'011000' (-0.13455996615808183+0.01596486633623835j)
a'100010'b'101000' (0.02627998906590844-0.008666144726414457j)
a'100010'b'110000' (-0.0709613517877196-0.0197132884712388j)
a'001100'b'000011' (0.1224940608855134+0.039759527680140516j)
a'001100'b'000101' (-0.037171903490150836-0.04774462955241403j)
a'001100'b'001001' (-0.04951049145222776-0.07646668547008682j)
a'001100'b'010001' (-0.03660555351102872-0.05197512119100194j)
a'001100'b'100001' (-0.05471307342765709-0.05894870867080008j)
a'001100'b'000110' (-0.017551990124147182+0.013048263786556625j)
a'001100'b'001010' (-0.008578823235300242-0.064791525471155j)
a'001100'b'010010' (-0.0794763665688859-0.020697746733308795j)
a'001100'b'100010' (-0.05286570620432256+0.047498253578123865j)
a'001100'b'001100' (-0.058895917736748134-0.081347180463595j)
a'001100'b'010100' (-0.007759172202146406+0.05585820847203037j)
a'001100'b'100100' (-0.036062831225000126+0.02186095592482418j)
a'001100'b'011000' (-0.012705771152444773-0.007353347648629563j)
a'001100'b'101000' (0.0070354555738548165-0.0036289546523589566j)
a'001100'b'110000' (-0.029582394021539535-0.060552532466492705j)
a'010100'b'000011' (6.622821825742936e-05+0.0681952168707027j)
a'010100'b'000101' (0.05664755155745416+0.012608551362744549j)
a'010100'b'001001' (0.0138051397384802-0.013050337572465955j)
a'010100'b'010001' (0.004496029529511566-0.056822880967882156j)
a'010100'b'100001' (0.011035612932916137+0.06715112375090569j)
a'010100'b'000110' (-0.007926576361187055+0.024581054996624604j)
a'010100'b'001010' (-0.007221163323278212-0.032101198716699794j)
a'010100'b'010010' (0.03457640928642192-0.009883272537517147j)
a'010100'b'100010' (-0.0002100658318735185+0.04804139071616753j)
a'010100'b'001100' (0.04921139098211052+0.09974598199436055j)
a'010100'b'010100' (0.006272303880276687-0.094077639714006j)
a'010100'b'100100' (-0.13033144231952862+0.022472718076640478j)
a'010100'b'011000' (-0.02376087225247356-0.04323336784130257j)
a'010100'b'101000' (0.057059244155773306-0.0158143686773337j)
a'010100'b'110000' (-0.09958582055213429+0.014698334557906955j)
a'100100'b'000011' (0.013667655504338473-0.051759133891604366j)
a'100100'b'000101' (-0.006761905333534233+0.02645485421797603j)
a'100100'b'001001' (0.04678657961983994+0.00886406725591139j)
a'100100'b'010001' (0.05039837441774301+0.05187329892695733j)
a'100100'b'100001' (0.020879635847606985-0.005502261984408794j)
a'100100'b'000110' (0.029296559916562537-4.6224234887195736e-05j)
a'100100'b'001010' (0.10494018744485221-0.011748051523380843j)
a'100100'b'010010' (0.0550443077127877-0.05913140822850689j)
a'100100'b'100010' (-0.04712287222195874-0.039790127610441046j)
a'100100'b'001100' (-0.0459825246538286-0.02826997482793556j)
a'100100'b'010100' (0.07294733158665508-0.12576661694561356j)
a'100100'b'100100' (0.0833211126381411-0.07497605001654231j)
a'100100'b'011000' (-0.021028541603996788-0.07243408958838198j)
a'100100'b'101000' (0.11143190144680012+0.020447188098985658j)
a'100100'b'110000' (-0.06532435889335994-0.022563522452408134j)
a'011000'b'000011' (0.0010730525671674505-0.015364089498137617j)
a'011000'b'000101' (-0.006599917256713282+0.036997317238882325j)
a'011000'b'001001' (-0.025545180922587812-0.07570351016071912j)
a'011000'b'010001' (-0.07733984929045139+0.00019240812307149037j)
a'011000'b'100001' (0.02856668372417992-0.028220227879004037j)
a'011000'b'000110' (-0.012719202300114975+0.04076877128797158j)
a'011000'b'001010' (0.09153121113691055+0.013680128959847075j)
a'011000'b'010010' (-0.026065695840054616-0.024847397166953698j)
a'011000'b'100010' (-0.05497386815165179+0.05560361472712326j)
a'011000'b'001100' (-0.0352176621951306+0.0063452179841532435j)
a'011000'b'010100' (-0.04745566173938755+0.05212466048842462j)
a'011000'b'100100' (0.028689233909716467-0.07570126188148839j)
a'011000'b'011000' (-0.05601917739877246-0.012081046706559585j)
a'011000'b'101000' (0.0025954874034302706-0.018664684970064294j)
a'011000'b'110000' (0.02126083246419722+0.006668798164589973j)
a'101000'b'000011' (-0.07607398924195341-0.020762730007560112j)
a'101000'b'000101' (0.033204709675436844+0.021540356898001906j)
a'101000'b'001001' (-0.03130067727988037+0.05282703284071474j)
a'101000'b'010001' (-0.04912767484196668-0.03238053985091246j)
a'101000'b'100001' (-0.039786443768841474+0.03891924726280558j)
a'101000'b'000110' (-0.09518320985767065+0.0094622249429269j)
a'101000'b'001010' (0.048482860520134945-0.023707016268290033j)
a'101000'b'010010' (0.03858146636359309+0.030325296129766584j)
a'101000'b'100010' (0.05337739639532226+0.05946904025892785j)
a'101000'b'001100' (-0.0540393743270462+0.05245424666704675j)
a'101000'b'010100' (-0.0451621603374589+0.06132547125641523j)
a'101000'b'100100' (-0.02616185429052239+0.03806333878452581j)
a'101000'b'011000' (-0.018043437504057146-0.06662481716338287j)
a'101000'b'101000' (0.06628805381565807-0.021672428698911308j)
a'101000'b'110000' (-0.07925704501995474-0.07127439091788104j)
a'110000'b'000011' (-0.003772782423015139+0.026193983121901594j)
a'110000'b'000101' (0.05171852177030193-0.0812605545399907j)
a'110000'b'001001' (-0.017828400331268417+0.00774667977673274j)
a'110000'b'010001' (-0.0060795019890248-0.08257364230861926j)
a'110000'b'100001' (-0.01251630739736172+0.06625290739296169j)
a'110000'b'000110' (-0.011775793756219274-0.11589429041624039j)
a'110000'b'001010' (0.012450560453236994+0.042160788465662985j)
a'110000'b'010010' (0.021800344002429188+0.03836658400434301j)
a'110000'b'100010' (-0.09178264827968119+0.04336604713145422j)
a'110000'b'001100' (0.011124344131791067+0.03411196018513739j)
a'110000'b'010100' (0.10396414390529536-0.057902930189246964j)
a'110000'b'100100' (0.026239307282112427-0.030887244217474946j)
a'110000'b'011000' (-0.012545943541226333+0.017279503133101847j)
a'110000'b'101000' (0.015462411321244141-0.01753842665657189j)
a'110000'b'110000' (-0.024507797109820872+0.06997591781859352j)
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.02445676580705045-0.015619924911764664j)
a'000011'b'000101' (0.028018099166678176+0.032646728427452476j)
a'000011'b'001001' (-0.05399748499539618+0.003020200236684003j)
a'000011'b'010001' (-0.024743636785795137-0.007867206414212083j)
a'000011'b'100001' (-0.04677215295170174-0.08086156093154567j)
a'000011'b'000110' (-0.0450833848031735+0.0013141817064688671j)
a'000011'b'001010' (-0.052907022532953006-0.007077511389100968j)
a'000011'b'010010' (0.028152078930614305-0.09519928971493256j)
a'000011'b'100010' (-0.004863756484536649+0.011056034108746473j)
a'000011'b'001100' (0.0038426269076980765-0.014224351436419964j)
a'000011'b'010100' (0.022344616943923805+0.039777758934627906j)
a'000011'b'100100' (0.03260203056581748+0.0008894327198292369j)
a'000011'b'011000' (0.057730998890079765+0.009293343232578315j)
a'000011'b'101000' (-0.013079792024402216-0.03969132915919795j)
a'000011'b'110000' (0.034575412800908346+0.04687722142321126j)
a'000101'b'000011' (-0.070073717458666+0.027751750887919653j)
a'000101'b'000101' (0.03275475824646415+0.0745941297186061j)
a'000101'b'001001' (-0.017974117504758608+0.01318608511803354j)
a'000101'b'010001' (-0.010813571371841992+0.022556920004826772j)
a'000101'b'100001' (-0.046110581074712796-0.05311912894883995j)
a'000101'b'000110' (0.0020154081690716896-0.03504483867184548j)
a'000101'b'001010' (0.0708074281788422-0.028821386456220944j)
a'000101'b'010010' (-0.03185712743716079+0.02923403227474289j)
a'000101'b'100010' (-0.06134485079747276+0.007333845885261939j)
a'000101'b'001100' (-0.002088711182374005-0.07481745223898453j)
a'000101'b'010100' (0.006021259586854607-0.030719581448899105j)
a'000101'b'100100' (0.006628795696162422+0.0574721701465208j)
a'000101'b'011000' (-0.014123496945868605+0.0638275273649791j)
a'000101'b'101000' (-0.00013465854879948086+0.09675086696282002j)
a'000101'b'110000' (-0.05994260193486936-0.032904595528144474j)
a'001001'b'000011' (-0.0008595625045246715+0.015094357295514537j)
a'001001'b'000101' (0.000991294830223803+0.06930647118950546j)
a'001001'b'001001' (0.01497891981742171+0.08774158149977697j)
a'001001'b'010001' (0.03715676767555076-0.004514253187830761j)
a'001001'b'100001' (0.03299388364912938+0.02114672234261448j)
a'001001'b'000110' (0.012341428016631831+0.028929600660493302j)
a'001001'b'001010' (-0.030769313805422645-0.025827473193499473j)
a'001001'b'010010' (-0.18937471460792665+0.025762948997915897j)
a'001001'b'100010' (0.09085394763732602+0.007675102268194629j)
a'001001'b'001100' (0.0605272384223389+0.04825895471002453j)
a'001001'b'010100' (0.0742367747575971+0.01935887292864371j)
a'001001'b'100100' (-0.09297968298580857-0.04727694855083145j)
a'001001'b'011000' (0.13234048183091351-0.01969124401793368j)
a'001001'b'101000' (0.003881156405172625+0.06973430597796998j)
a'001001'b'110000' (-0.06437103417714113+0.03746287339428908j)
a'010001'b'000011' (0.052312777783764364+0.07868367855249774j)
a'010001'b'000101' (-0.10855586580863755-0.006143588593837311j)
a'010001'b'001001' (0.020281724655301526-0.07266135053099923j)
a'010001'b'010001' (-0.06436746696915334-0.05997522965291721j)
a'010001'b'100001' (-0.0347716052105829-0.06899233560653374j)
a'010001'b'000110' (-0.011054554055743251+0.012269325793099152j)
a'010001'b'001010' (-0.06563146795042674-0.023563539665693873j)
a'010001'b'010010' (-0.0032961073318400437-0.046024738059013866j)
a'010001'b'100010' (0.05110812629455924+0.013202797019682726j)
a'010001'b'001100' (0.012716840729694461+0.00530066457731376j)
a'010001'b'010100' (-0.04226788908539212-0.08708881879358259j)
a'010001'b'100100' (0.07057163580757868+0.020204091645651664j)
a'010001'b'011000' (0.023664965789592554-0.07903907308818925j)
a'010001'b'101000' (-0.0010108965423243931-0.0034903250556450383j)
a'010001'b'110000' (-0.033725478346511704+0.017466221303743826j)
a'100001'b'000011' (0.05604555867851424+0.004450694306154114j)
a'100001'b'000101' (0.03403620183282701-0.004201530798529675j)
a'100001'b'001001' (-0.024918103578061+0.004607175630788116j)
a'100001'b'010001' (-0.023573271328145344+0.021531475845246922j)
a'100001'b'100001' (0.006434145838288042-0.006659580359664921j)
a'100001'b'000110' (-0.03391001927673214+0.028054555891887697j)
a'100001'b'001010' (0.018744434094721093-0.010313381121222218j)
a'100001'b'010010' (-0.04316945923677556+0.035545273568231624j)
a'100001'b'100010' (-0.0014761988663983486+0.018471638950735333j)
a'100001'b'001100' (0.02467692162011862-0.031122856884604012j)
a'100001'b'010100' (0.033303177040138784-0.03850836213246307j)
a'100001'b'100100' (0.03668283947927525+0.030772089827200193j)
a'100001'b'011000' (-0.026451090481790774+0.01904799839494942j)
a'100001'b'101000' (0.060427353809017724-0.02465937962398265j)
a'100001'b'110000' (-0.028245440760635163-0.04502886373501082j)
a'000110'b'000011' (-0.002626318563675907-0.001728253814495619j)
a'000110'b'000101' (0.06197001900905355+0.027261972980964794j)
a'000110'b'001001' (-0.027041939171802663-0.006797129563399111j)
a'000110'b'010001' (0.10057170254686808+0.05335748684218751j)
a'000110'b'100001' (-0.09224157475661716-0.0071419934307862705j)
a'000110'b'000110' (-0.0478128280410435-0.002018328186879692j)
a'000110'b'001010' (-0.02030105943782987-0.02345480950180769j)
a'000110'b'010010' (-0.01826358928620333-0.030611990362575524j)
a'000110'b'100010' (0.027384742868545375+0.05086423425176537j)
a'000110'b'001100' (0.002873383484272291-0.004078870706786226j)
a'000110'b'010100' (-0.029223259204856532+0.010538676980761821j)
a'000110'b'100100' (0.0013085999991638772-0.014894532296243716j)
a'000110'b'011000' (0.11637413628924519-0.05923704929571294j)
a'000110'b'101000' (-0.013654633968013814-0.13344400423309352j)
a'000110'b'110000' (0.03647817538096101+0.04777422719783185j)
a'001010'b'000011' (0.04894470772039067-0.008701090869012357j)
a'001010'b'000101' (0.001285680717770677+0.05386204831914687j)
a'001010'b'001001' (-0.06402402787428331-0.013083052924375052j)
a'001010'b'010001' (0.061664491410021297-0.004167458846401538j)
a'001010'b'100001' (0.015699449334237597-0.00811447394747751j)
a'001010'b'000110' (-0.0032767900228882663-0.014137286596081917j)
a'001010'b'001010' (-0.006120262932382194+0.07012311930944572j)
a'001010'b'010010' (0.014866871545096565-0.06328996890640447j)
a'001010'b'100010' (0.0022686401864811107-0.1297224147258879j)
a'001010'b'001100' (-0.051868875007178+0.04343866380819274j)
a'001010'b'010100' (0.06802299028219137+0.021277855612791902j)
a'001010'b'100100' (-0.055336015653650615+0.010469245623309255j)
a'001010'b'011000' (-0.012076807268019287+0.028926982749181512j)
a'001010'b'101000' (-0.11259721488081884-0.041821974898858166j)
a'001010'b'110000' (-0.016745974268279985+0.04738469020966034j)
a'010010'b'000011' (-0.012967492152058958-0.03967636492230804j)
a'010010'b'000101' (0.024324138829221256+0.057648624669571956j)
a'010010'b'001001' (-0.0035738435332314626+0.0008140745506480254j)
a'010010'b'010001' (-0.030886232398171704+0.014354837345119751j)
a'010010'b'100001' (-0.05165778776977986-0.010714889727173844j)
a'010010'b'000110' (0.031984978858291054+0.03777969626436932j)
a'010010'b'001010' (0.01566718571896518+0.004646212415008767j)
a'010010'b'010010' (0.027284717473827658-0.041879343807383125j)
a'010010'b'100010' (-0.03353921432491071+0.003178719694457215j)
a'010010'b'001100' (-0.03430596412048563-0.049639208987711694j)
a'010010'b'010100' (-0.00641389659593739+0.03074152984134742j)
a'010010'b'100100' (0.016779819266114597+0.05566277737502463j)
a'010010'b'011000' (-0.006723079937106368+0.061140807383545j)
a'010010'b'101000' (-0.01695558713339557-0.010358327915801796j)
a'010010'b'110000' (0.030248247912357723+0.02827221478845536j)
a'100010'b'000011' (-0.000774883627077283+0.014663287723538738j)
a'100010'b'000101' (0.017050294711608023-0.023256444798420407j)
a'100010'b'001001' (0.049938748150273556-0.0029976929080809227j)
a'100010'b'010001' (0.022919757601873307-0.02218743591309039j)
a'100010'b'100001' (-0.0646394958244615-0.05570141893719444j)
a'100010'b'000110' (-0.004817380421614891-0.01093471654583531j)
a'100010'b'001010' (0.05050232431986009+0.04709608729812489j)
a'100010'b'010010' (-0.016099191921772317-0.041539243064761484j)
a'100010'b'100010' (-0.02275545716256847-0.013326977026344822j)
a'100010'b'001100' (0.02737651107460006-0.12271803353963899j)
a'100010'b'010100' (-0.05823146331657471+0.045931829855142936j)
a'100010'b'100100' (-0.030947680921457266+0.010534131983684929j)
a'100010'b'011000' (-0.13455996615808177+0.015964866336238386j)
a'100010'b'101000' (0.02627998906590844-0.008666144726414469j)
a'100010'b'110000' (-0.07096135178771965-0.019713288471238603j)
a'001100'b'000011' (0.12249406088551332+0.0397595276801405j)
a'001100'b'000101' (-0.03717190349015075-0.047744629552414077j)
a'001100'b'001001' (-0.049510491452227884-0.07646668547008674j)
a'001100'b'010001' (-0.03660555351102878-0.05197512119100186j)
a'001100'b'100001' (-0.05471307342765714-0.0589487086708j)
a'001100'b'000110' (-0.01755199012414716+0.013048263786556638j)
a'001100'b'001010' (-0.00857882323530028-0.06479152547115496j)
a'001100'b'010010' (-0.07947636656888586-0.020697746733308788j)
a'001100'b'100010' (-0.05286570620432255+0.047498253578123845j)
a'001100'b'001100' (-0.058895917736748155-0.08134718046359499j)
a'001100'b'010100' (-0.007759172202146301+0.05585820847203037j)
a'001100'b'100100' (-0.03606283122500012+0.021860955924824173j)
a'001100'b'011000' (-0.012705771152444771-0.007353347648629554j)
a'001100'b'101000' (0.007035455573854808-0.0036289546523589687j)
a'001100'b'110000' (-0.029582394021539622-0.060552532466492635j)
a'010100'b'000011' (6.622821825741018e-05+0.06819521687070268j)
a'010100'b'000101' (0.05664755155745417+0.012608551362744483j)
a'010100'b'001001' (0.013805139738480172-0.013050337572465983j)
a'010100'b'010001' (0.004496029529511587-0.05682288096788214j)
a'010100'b'100001' (0.01103561293291618+0.06715112375090566j)
a'010100'b'000110' (-0.007926576361187024+0.0245810549966246j)
a'010100'b'001010' (-0.007221163323278204-0.03210119871669978j)
a'010100'b'010010' (0.03457640928642191-0.00988327253751713j)
a'010100'b'100010' (-0.0002100658318734995+0.048041390716167524j)
a'010100'b'001100' (0.049211390982110706+0.09974598199436041j)
a'010100'b'010100' (0.006272303880276709-0.09407763971400597j)
a'010100'b'100100' (-0.13033144231952856+0.022472718076640752j)
a'010100'b'011000' (-0.023760872252473527-0.043233367841302564j)
a'010100'b'101000' (0.05705924415577326-0.015814368677333795j)
a'010100'b'110000' (-0.09958582055213423+0.014698334557907054j)
a'100100'b'000011' (0.013667655504338475-0.05175913389160436j)
a'100100'b'000101' (-0.006761905333534244+0.026454854217976033j)
a'100100'b'001001' (0.046786579619839966+0.008864067255911339j)
a'100100'b'010001' (0.05039837441774306+0.05187329892695729j)
a'100100'b'100001' (0.02087963584760698-0.005502261984408811j)
a'100100'b'000110' (0.029296559916562527-4.6224234887214805e-05j)
a'100100'b'001010' (0.10494018744485217-0.011748051523380834j)
a'100100'b'010010' (0.05504430771278765-0.05913140822850689j)
a'100100'b'100010' (-0.04712287222195877-0.039790127610440984j)
a'100100'b'001100' (-0.0459825246538286-0.02826997482793556j)
a'100100'b'010100' (0.07294733158665477-0.1257666169456137j)
a'100100'b'100100' (0.0833211126381409-0.07497605001654252j)
a'100100'b'011000' (-0.021028541603996913-0.0724340895883819j)
a'100100'b'101000' (0.11143190144680012+0.020447188098985512j)
a'100100'b'110000' (-0.06532435889335997-0.02256352245240806j)
a'011000'b'000011' (0.0010730525671674563-0.01536408949813761j)
a'011000'b'000101' (-0.006599917256713208+0.03699731723888233j)
a'011000'b'001001' (-0.02554518092258797-0.07570351016071906j)
a'011000'b'010001' (-0.07733984929045137+0.00019240812307152327j)
a'011000'b'100001' (0.028566683724179906-0.028220227879004044j)
a'011000'b'000110' (-0.012719202300114966+0.04076877128797155j)
a'011000'b'001010' (0.09153121113691051+0.013680128959847056j)
a'011000'b'010010' (-0.026065695840054602-0.02484739716695368j)
a'011000'b'100010' (-0.054973868151651784+0.055603614727123246j)
a'011000'b'001100' (-0.03521766219513058+0.006345217984153263j)
a'011000'b'010100' (-0.04745566173938755+0.05212466048842456j)
a'011000'b'100100' (0.028689233909716304-0.07570126188148843j)
a'011000'b'011000' (-0.05601917739877244-0.01208104670655957j)
a'011000'b'101000' (0.0025954874034302576-0.01866468497006429j)
a'011000'b'110000' (0.021260832464197216+0.006668798164589958j)
a'101000'b'000011' (-0.07607398924195338-0.020762730007560088j)
a'101000'b'000101' (0.03320470967543686+0.021540356898001864j)
a'101000'b'001001' (-0.03130067727988031+0.052827032840714785j)
a'101000'b'010001' (-0.04912767484196669-0.03238053985091244j)
a'101000'b'100001' (-0.039786443768841426+0.03891924726280567j)
a'101000'b'000110' (-0.09518320985767062+0.009462224942926867j)
a'101000'b'001010' (0.04848286052013493-0.023707016268290033j)
a'101000'b'010010' (0.038581466363593074+0.030325296129766578j)
a'101000'b'100010' (0.0533773963953223+0.059469040258927866j)
a'101000'b'001100' (-0.05403937432704608+0.05245424666704686j)
a'101000'b'010100' (-0.04516216033745876+0.06132547125641528j)
a'101000'b'100100' (-0.026161854290522334+0.03806333878452584j)
a'101000'b'011000' (-0.01804343750405718-0.06662481716338284j)
a'101000'b'101000' (0.06628805381565804-0.021672428698911426j)
a'101000'b'110000' (-0.0792570450199548-0.07127439091788099j)
a'110000'b'000011' (-0.0037727824230151513+0.02619398312190159j)
a'110000'b'000101' (0.05171852177030186-0.08126055453999075j)
a'110000'b'001001' (-0.017828400331268417+0.00774667977673275j)
a'110000'b'010001' (-0.006079501989024799-0.08257364230861923j)
a'110000'b'100001' (-0.01251630739736173+0.06625290739296169j)
a'110000'b'000110' (-0.011775793756219316-0.11589429041624034j)
a'110000'b'001010' (0.012450560453236989+0.04216078846566297j)
a'110000'b'010010' (0.021800344002429167+0.03836658400434302j)
a'110000'b'100010' (-0.09178264827968109+0.04336604713145446j)
a'110000'b'001100' (0.011124344131791123+0.03411196018513736j)
a'110000'b'010100' (0.10396414390529524-0.05790293018924706j)
a'110000'b'100100' (0.026239307282112385-0.030887244217474973j)
a'110000'b'011000' (-0.012545943541226316+0.01727950313310185j)
a'110000'b'101000' (0.015462411321244124-0.017538426656571907j)
a'110000'b'110000' (-0.024507797109820838+0.06997591781859351j)
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