<jupyter_start><jupyter_text>Get non-contextual H<jupyter_code>nonH_guesses = c.greedy_dfs(ham, 10, criterion='weight')

nonH = max(nonH_guesses, key=lambda x:len(x)) # largest nonCon part found by dfs alg<jupyter_output><empty_output><jupyter_text>Split into:$$H = H_{c} + H_{nc}$$<jupyter_code>nonCon_H = {}
Con_H = {}

for P in ham:
    if P in nonH:
        nonCon_H[P]=ham[P]
    else:
        Con_H[P]=ham[P]<jupyter_output><empty_output><jupyter_text>Testing contextuality<jupyter_code>print('Is NONcontextual correct:', not c.contextualQ_ham(nonCon_H))
print('Is contextual correct:',c.contextualQ_ham(Con_H))<jupyter_output>Is NONcontextual correct: True
Is contextual correct: True<jupyter_text>Classical part of problem! Take $H_{nc}$ and split into:- $Z$ = operators that completely comute with all operators in $S$- $T$ = remaining operators in $S$    - where $S = Z \cup T$  and $S$ is set of Pauli operators in $H_{nc}$        - We then split the set $T$ into cliques $C_{1}, C_{2}, ... , C_{|T|}$    - all ops in a clique commute    - ops between cliques anti-commute!<jupyter_code>bool_flag, Z_list, T_list = c.contextualQ(list(nonCon_H.keys()), verbose=True)
Z_list
T_list<jupyter_output><empty_output><jupyter_text>Get quasi modelFirst we define- $C_{i1}$ = first Pauli in each $C_{i}$ set- $A_{ij} = C_{ij}C_{1i}$- $G^{prime} = \{1 P_{i} \;| \; i=1,2,...,|Z| \}$    - aka all the completely commuting terms with coefficients set to +1!- We define G to be an independent set of $G^{prime}$    - where $G \subseteq G^{prime}$<jupyter_code>G_list, Ci1_list, all_mappings = c.quasi_model(nonCon_H)
print('non-independent Z list:', Z_list)
print('G (independent) Z list:', G_list)
print('all Ci1 terms:', Ci1_list)<jupyter_output>all Ci1 terms: ['IIIZI', 'IIZXZ']<jupyter_text>$$R = G \cup \{ C_{i1} \;| \; i=1,2,...,N \}$$<jupyter_code># Assemble all the mappings from terms in the Hamiltonian to their products in R:
all_mappings<jupyter_output><empty_output><jupyter_text>Overall $R$ is basically reduced non-contextual set- where everything in original non-contextual set can be found by **inference!**  Function form$$R = G \cup \{ C_{i1} \;| \; i=1,2,...,N \}$$- note q to do with $G$- note r to do with $C_{i1}$<jupyter_code>model = [G_list, Ci1_list, all_mappings]

fn_form = c.energy_function_form(nonCon_H, model)

# returns [
#            denstion of q,
#            dimension of r,
#            [coeff, indices of q's, indices of r's, term in Hamiltonian]
#         ]

fn_form
Energy_function = c.energy_function(fn_form)
import random

### now for the q terms we only have +1 or -1 assignment!
q_variables = [random.choice([1,-1]) for _ in range(fn_form[0])]


### r variables is anything that makes up unit vector!
r_variables = c.angular(np.arange(0,2*np.pi, fn_form[1]))
r_variables
 Energy_function(*q_variables,*r_variables)<jupyter_output><empty_output><jupyter_text>find_gs_nonconfunction optimizes above steps by:1. brute forcing all choices of ```q_variables```    - ```itertools.product([1,-1],repeat=fn_form[0])```2. optimizing over ```r_variables``` (in code ```x```)    - using SciPy optimizer!<jupyter_code>model = [G_list, Ci1_list, all_mappings]

lowest_eigenvalue, ground_state_params, model_copy, fn_form_copy,  = c.find_gs_noncon(nonCon_H,
               method = 'differential_evolution',
               model=model,
               fn_form=fn_form) # returns:  best + [model, fn_form]

print(lowest_eigenvalue)
print(ground_state_params)
## check
Energy_function(*ground_state_params[0],*ground_state_params[1]) == lowest_eigenvalue<jupyter_output><empty_output><jupyter_text>Now need to rotate Hamiltonian! We now have non contextual ground state: $(\vec{q}, \vec{r})$<jupyter_code>ground_state_params<jupyter_output><empty_output><jupyter_text>We can use this result - ground state of $H_{nc}$ -  as a classical estiamte of our ground state of the full Hamiltonian ($H = H_{c} + H_{nc}$)However we can also obtain a quantum correction using $H_{c}$By minimizing theenergy of the remaining terms in the Hamiltonian over the quantum states that are **consistent with the noncon-textual ground state**. To do this we first rotate each $G_{j}$ and $\mathcal{A} = \sum_{i=1}^{N} r_{i}A_{i}$:<jupyter_code>model = [G_list, Ci1_list, all_mappings]

print(G_list) # G_j terms!
print(Ci1_list) # mathcal(A)<jupyter_output>['ZIIII', 'IZIII', 'IIZII', 'IIIIZ']
['IIIZI', 'IIZXZ']<jupyter_text>to SINGLE QUBIT pauli Z operators!- to map the operators in $G$ to single qubit Pauli operators, we use $\frac{\pi}{2}$ rotations!- note $\mathcal{A}$ is an anti-commuting set... therefore we can use $N-1$ rotations as in unitary partitioning's sequence of rotations to do this!    - $R^{\dagger}\mathcal{A} R = \text{single Pauli op}$  Rotate full Hamiltonian to basis with diagonal noncontextual generators! function ```diagonalize_epistemic```:1. first if else statement:    - if cliques present:        - first maps A to single Pauli operator (if cliques present)        - then rotates to diagonlize G union with single Pauli opator of A (hence GuA name!)    - else if NO cliques present:        - gets rotations to diagonlize G             - these rotations make up GuA term in code!2. NEXT code loops over terms in GuA (denoted as g in code)    - if g is not a single qubit $Z$:        - code generates code to rotate operator to make g diagonal (rotations)        - then constructs map of g to single Z (J rotation)    - Note R is applied to GuA        - Note rotations are given in Appendix A of https://arxiv.org/pdf/2011.10027.pdf    - First code checks if g op in GuA is diagonal        - if so then needs to apply "K" rotation (involving $Y$ and $I$ operators (see pg 11 top) to make it NOT diagononal    - now operator will be diagnoal!    - next generate "J" rotation        - turns non-diagonal operator into a single qubit $Z$ operator!<jupyter_code># Get sequence of rotations requried to diagonalize the generators for the noncontextual ground state!

Rotations_list, diagonalized_generators_GuA, eigen_vals_nonC_ground_state_GuA_ops = c.diagonalize_epistemic(model,
                                                                                                            fn_form,
                                                                                                            ground_state_params)
# rotations to map A to single Pauli operator!
Rotations_list
# rotations to diagonlize G
diagonalized_generators_GuA
eigen_vals_nonC_ground_state_GuA_ops<jupyter_output><empty_output><jupyter_text>NEW LCU method<jupyter_code>N_index=0
check_reduction=True
N_Qubits= hamiltonians[mol_key][1]
R_LCU, Rotations_list, diagonalized_generators_GuA, eigen_vals_nonC_ground_state_GuA_ops= c.diagonalize_epistemic_LCU(
                                                                                  model,
                                                                                  fn_form,
                                                                                  ground_state_params,
                                                                                  N_Qubits,
                                                                                  N_index,
                                                                                  check_reduction=check_reduction)
R_LCU
order = list(range(hamiltonians[mol_key][1]))
N_index=0
check_reduction=True
N_Qubits= hamiltonians[mol_key][1]

reduced_H = c.get_reduced_hamiltonians_LCU(Con_H,
                               model,
                               fn_form,
                               ground_state_params,
                               order, 
                               N_Qubits,
                               N_index, 
                               check_reduction=check_reduction)
len(reduced_H[-1])
reduced_H[3]
H = conv_scr.Get_Openfermion_Hamiltonian(reduced_H[-1])
sparseH = qubit_operator_sparse(H, n_qubits=hamiltonians[mol_key][1])
sp.sparse.linalg.eigsh(sparseH, which='SA', k=1)[0][0]
## old way
# Get sequence of rotations requried to diagonalize the generators for the noncontextual ground state!

Rotations_list, diagonalized_generators_GuA, eigen_vals_nonC_ground_state_GuA_ops = c.diagonalize_epistemic(model,
                                                                                                            fn_form,
                                                                                                            ground_state_params)
len(diagonalized_generators_GuA)
Rotations_list
### old way
order = list(range(hamiltonians[mol_key][1]))
red_H = c.get_reduced_hamiltonians(ham,
                           model,
                           fn_form,
                           ground_state_params,
                           order)
len(red_H[0])
len(red_H[0])
red_H[0]
H = conv_scr.Get_Openfermion_Hamiltonian(red_H[-1])
sparseH = qubit_operator_sparse(H, n_qubits=hamiltonians[mol_key][1])
sp.sparse.linalg.eigsh(sparseH, which='SA', k=1)[0][0]
from scipy.sparse.linalg import expm
from Misc_functions import sparse_allclose

R_LCU_QubitOp = QubitOperator()
for P in R_LCU: R_LCU_QubitOp+=P
R_LCU_mat = qubit_operator_sparse(R_LCU_QubitOp, n_qubits=hamiltonians[mol_key][1])



R_SeqRot_QubitOp= conv_scr.convert_op_str(Rotations_list[0][1], 1)
R_SeqRot_mat = qubit_operator_sparse(R_SeqRot_QubitOp, n_qubits=hamiltonians[mol_key][1])

theta_sk=Rotations_list[0][0]
exp_rot = expm(R_SeqRot_mat * theta_sk)# / 2)

sparse_allclose(exp_rot, R_LCU_mat)<jupyter_output><empty_output><jupyter_text>Restricting the Hamiltonian to a contextualsubspace (Section B of https://arxiv.org/pdf/2011.10027.pdf)In the rotated basis the Hamiltonian is restricted to the subspace stabilized by the noncontextual generators $G_{j}'$<jupyter_code>print(diagonalized_generators_GuA) # G_j' terms!<jupyter_output><empty_output><jupyter_text>The quantum correction is then obtained by minimizing the expectation value of this resticted Hamiltonian!(over +1 eigenvectors of the remaining non-contextual generators $\mathcal{A}'$)<jupyter_code>print(Ci1_list) # mathcal(A)<jupyter_output><empty_output><jupyter_text>- $\mathcal{H}_{1}$ denotes Hilbert space of $n_{1}$ qubits acted on by by the single qubit $G_{j}'$ terms- $\mathcal{H}_{2}$ denotes Hilbert space of remaining $n_{2}$Overall full Hilbert space is: $\mathcal{H}=\mathcal{H}_{1} \otimes \mathcal{H}_{2}$The **contextual Hamiltonian** in this rotated basis is:$$H_{c}'=\sum_{P \in \mathcal{S_{c}'}} h_{P}P$$The set of Pauli terms in $H_{c}'$ is $\mathcal{S_{c}'}$, where terms in $\mathcal{S_{c}'}$ act on both $\mathcal{H}_{1}$ and $\mathcal{H}_{2}$ subspaces in general!We can write $P$ terms as:$$P=P_{1}^{\mathcal{H}_{1}} \otimes P_{2}^{\mathcal{H}_{2}}$$$P$ commutes with an element of $G'$ if and only if $P_{1} \otimes \mathcal{I}^{\mathcal{H}_{2}}$ doesAs the generators $G'$ act only on $\mathcal{H}_{1}$ If $P$ anticommutes with any element of $G'$ then its expection value in the noncontextual state is zeroThus any $P$ must commute with all elements of $G'$ and so $P_{1} \otimes \mathcal{I}^{\mathcal{H}_{2}}$ tooAs the elements of $G'$ are single-qubit Pauli $Z$ operators acting in $\mathcal{H}_{1}$:<jupyter_code>print(diagonalized_generators_GuA) # G_j' terms!<jupyter_output><empty_output><jupyter_text>$P_{1}$ must be a product of such operators!**As the exepcation value of $P_{1}$ is some $p_{1}= \pm 1$ DETERMINED BY THE NONCONTEXTUAL GROUND STATE**<jupyter_code>eigen_vals_nonC_ground_state_GuA_ops<jupyter_output><empty_output><jupyter_text>Let $|\psi_{(\vec{q}, \vec{r})} \rangle$ be any quantum state consistent with the nonconxtual ground state $(\vec{q}, \vec{r})$... aka gives correct expection values of:<jupyter_code>print(diagonalized_generators_GuA)
print(eigen_vals_nonC_ground_state_GuA_ops)<jupyter_output><empty_output><jupyter_text>Then the action of any $P$ which allows our contextual correction has the form:$$P |\psi_{(\vec{q}, \vec{r})} \rangle = \big( P_{1}^{\mathcal{H}_{1}} \otimes P_{2}^{\mathcal{H}_{2}} \big) |\psi_{(\vec{q}, \vec{r})} \rangle$$$$ = p_{1}\big( \mathcal{I}^{\mathcal{H}_{1}} \otimes P_{2}^{\mathcal{H}_{2}} \big) |\psi_{(\vec{q}, \vec{r})} \rangle$$- repeating above, but $p_{1}$ is the expectation value of $P_{1}$ determiend by the noncontextual ground state! Thus we can denote $H_{c}' |_{(\vec{q}, \vec{r})}$ as the restriction of $H_{c}'$ on its action on the noncontextual ground state $(\vec{q}, \vec{r})$:$$H_{c}' |_{(\vec{q}, \vec{r})} =\sum_{\substack{P \in \mathcal{S_{c}'} \\ \text{s.t.} [P, G_{i}']=0 \\ \forall G'_{i} \in G'}} p_{1}h_{P}\big( \mathcal{I}^{\mathcal{H}_{1}} \otimes P_{2}^{\mathcal{H}_{2}} \big) $$$$=\mathcal{I}_{\mathcal{H}_{1}} \otimes H_{c}'|_{\mathcal{H}_{2}} $$where we can write:$$H_{c}'|_{\mathcal{H}_{2}} = \sum_{\substack{P \in \mathcal{S_{c}'} \\ \text{s.t.} [P, G_{i}']=0 \\ \forall G'_{i} \in G'}} p_{1}h_{P}P_{2}^{\mathcal{H}_{2}}$$Cleary this Hamiltonian on $n_{2}$ qubits is given by:$$n_{2} = n - |G|$$- $|G|=$ number of noncontextual generators $G_{j}$<jupyter_code>from copy import deepcopy
import pprint<jupyter_output><empty_output><jupyter_text>```quantum_correction``` function<jupyter_code>n_q = len(diagonalized_generators_GuA[0])

rotated_H = deepcopy(ham) ##<-- full Hamiltonian

# iteratively perform R rotation over all terms in orginal Hamiltonian
for R in Rotations_list:
    newly_rotated_H={}
    for P in rotated_H.keys():
        lin_comb_Rot_P = c.apply_rotation(R,P) # linear combination of Paulis from R rotation on P
        
        for P_rot in lin_comb_Rot_P:
            
            if P_rot in newly_rotated_H.keys():
                newly_rotated_H[P_rot]+=lin_comb_Rot_P[P_rot]*rotated_H[P] # already in it hence +=
            else:
                newly_rotated_H[P_rot]=lin_comb_Rot_P[P_rot]*rotated_H[P]
                
    rotated_H = deepcopy(newly_rotated_H) ##<-- perform next R rotation on this H
    
rotated_H<jupyter_output><empty_output><jupyter_text>next find where Z indices in $G'$<jupyter_code>z_indices = []
for d in diagonalized_generators_GuA:
    for i in range(n_q):
        if d[i] == 'Z':
            z_indices.append(i)
            
print(diagonalized_generators_GuA)
print(z_indices)<jupyter_output><empty_output><jupyter_text>**The exepcation value of $P_{1}$ terms are $p_{1}= \pm 1$ DETERMINED BY THE NONCONTEXTUAL GROUND STATE**<jupyter_code>print(diagonalized_generators_GuA)
print(eigen_vals_nonC_ground_state_GuA_ops)<jupyter_output><empty_output><jupyter_text>We need to ENFORCE the diagnal geneators assigned values in the diagonal basis to these expectation values above^^^<jupyter_code>ham_red = {}
    
for P in rotated_H.keys():
    sgn = 1
    for j, z_index in enumerate(z_indices): # enforce diagonal generator's assigned values in diagonal basis
        if P[z_index] == 'Z':
            sgn = sgn*eigen_vals_nonC_ground_state_GuA_ops[j] #<- eigenvalue of nonC ground state!
        elif P[z_index] != 'I':
            sgn = 0

    if sgn != 0:
        # construct term in reduced Hilbert space
        P_red = ''
        for i in range(n_q):
            if not i in z_indices:
                P_red = P_red + P[i]
        if P_red in ham_red.keys():
            ham_red[P_red] = ham_red[P_red] + rotated_H[P]*sgn
        else:
            ham_red[P_red] = rotated_H[P]*sgn
            
ham_red
c.quantum_correction(ham, #<- full Ham
                     model,
                     fn_form,
                     ground_state_params)
c.quantum_correction(nonCon_H,model,fn_form,ground_state_params)
c.get_reduced_hamiltonians(ham,
                           model,
                           fn_form,
                           ground_state_params,
                           list(range(hamiltonians[mol_key][1])))[-1] == rotated_H ### aka when considering all qubit problem it is equal to rotated H!<jupyter_output><empty_output><jupyter_text>For some reason it seems that when considering full Hamiltonian there is no reduction in the number of terms!Q. Do you expect any term reduction when doing CS-VQE?<jupyter_code>n2 = hamiltonians[mol_key][1]-len(diagonalized_generators_GuA)
n2
ham_red
ham==Con_H
n_q = len(diagonalized_generators_GuA[0])
rotated_Hcon = deepcopy(Con_H)

# iteratively perform R rotation over all terms in orginal Hamiltonian
for R in Rotations_list:
    newly_rotated_H={}
    for P in rotated_Hcon.keys():
        lin_comb_Rot_P = c.apply_rotation(R,P) # linear combination of Paulis from R rotation on P
        
        for P_rot in lin_comb_Rot_P:
            
            if P_rot in newly_rotated_H.keys():
                newly_rotated_H[P_rot]+=lin_comb_Rot_P[P_rot]*rotated_Hcon[P] # already in it hence +=
            else:
                newly_rotated_H[P_rot]=lin_comb_Rot_P[P_rot]*rotated_Hcon[P]
                
    rotated_Hcon = deepcopy(newly_rotated_H) ##<-- perform next R rotation on this H
    
rotated_Hcon
print(diagonalized_generators_GuA)
print(eigen_vals_nonC_ground_state_GuA_ops)

p1_dict = {Gener.index('Z'): p1 for Gener, p1 in zip(diagonalized_generators_GuA, eigen_vals_nonC_ground_state_GuA_ops)}
p1_dict
new={}
for P1_P2 in rotated_Hcon.keys():
    Z_indices = [i for i, sigma in enumerate(P1_P2) if sigma=='Z']
    
    I1_P2=list(deepcopy(P1_P2))
    sign=1
    for ind in Z_indices:
        sign*=p1_dict[ind]
        I1_P2[ind]='I'
    I1_P2=''.join(I1_P2)
    
    new[I1_P2]=rotated_Hcon[P1_P2]*sign
    
new    
len(rotated_Hcon)-len(diagonalized_generators_GuA)
# len(new)
H = conv_scr.Get_Operfermion_Hamiltonian(new)
sparseH = qubit_operator_sparse(H, n_qubits=hamiltonians[mol_key][1])
sp.sparse.linalg.eigsh(sparseH, which='SA', k=1)[0][0]
H_reduced_subspace={}
for P in rotated_H.keys():
    
    sign=1
    for P_known, eigen_val in zip(diagonalized_generators_GuA, eigen_vals_nonC_ground_state_GuA_ops):
        Z_index = P_known.index('Z') # Find single qubit Z in generator!
        
        if P[Z_index]== 'Z': # compare location in genertor to P of rotated H
            
            sign*=eigen_val #<- eigenvalue of nonC ground state!
            
        elif P[Z_index]!= 'I': 
            sign=0 # MUST anti-commute!
    
    # build reduced Hilbert Space
    if sign!=0:
        P_new = list(deepcopy(P))
        P_new[Z_index]='I'
        P_new= ''.join(P_new)
        
        if P_new in H_reduced_subspace.keys():
            H_reduced_subspace[P_new] = H_reduced_subspace[P_new] + rotated_H[P]*sign
        else:
            H_reduced_subspace[P_new] = rotated_H[P]*sign
            
#     else:
#         H_reduced_subspace[P]=rotated_H[P]
print(len(rotated_H))
print(len(H_reduced_subspace))
# H_reduced_subspace
lowest_eigenvalue
from openfermion import qubit_operator_sparse
import conversion_scripts as conv_scr
import scipy as sp
H = conv_scr.Get_Operfermion_Hamiltonian(H_reduced_subspace)
sparseH = qubit_operator_sparse(H, n_qubits=hamiltonians[mol_key][1])
sp.sparse.linalg.eigsh(sparseH, which='SA', k=1)[0][0]
c.quantum_correction(ham, #<- full Ham
                     model,
                     fn_form,
                     ground_state_params)
lowest_eigenvalue
Hfull = conv_scr.Get_Operfermion_Hamiltonian(ham)
sparseHfull = qubit_operator_sparse(Hfull, n_qubits=hamiltonians[mol_key][1])
FCI = sp.sparse.linalg.eigsh(sparseHfull, which='SA', k=1)[0][0]
print('FCI=', FCI)
sp.sparse.linalg.eigsh(sparseH, which='SA', k=1)[0][0]
print(diagonalized_generators_GuA)
print(eigen_vals_nonC_ground_state_GuA_ops)

p1_dict = {Gener.index('Z'): p1 for Gener, p1 in zip(diagonalized_generators_GuA, eigen_vals_nonC_ground_state_GuA_ops)}
p1_dict
H_reduced_subspace={}
for P in rotated_Hcon.keys():
    
    new_sign=1
    P_new = list(P)
    for index, sigma in enumerate(P):
        if sigma == 'Z':
            new_sign*=p1_dict[index]
            P_new[index]='I'
    
    P_new = ''.join(P_new)
    H_reduced_subspace[P_new] = rotated_Hcon[P]*new_sign
H_reduced_subspace

H_con_subspace = conv_scr.Get_Operfermion_Hamiltonian(H_reduced_subspace)
sparseH_con_subspace = qubit_operator_sparse(H_con_subspace, n_qubits=hamiltonians[mol_key][1])
sp.sparse.linalg.eigsh(sparseH_con_subspace, which='SA', k=1)[0][0]
# H_reduced_subspace={}
# for P in rotated_Hcon.keys():
    
#     p1=1
#     for P_known, eigen_val in zip(diagonalized_generators_GuA, eigen_vals_nonC_ground_state_GuA_ops):
#         Z_index = P_known.index('Z') # Find single qubit Z in generator!
        
#         if P[Z_index]== 'Z': # compare location in genertor to P of rotated H
#             p1*=eigen_val #<- eigenvalue of nonC ground state!
            
#             P1_P2 = list(deepcopy(P))
#             P1_P2[Z_index]='I'
#             I1_P2= ''.join(P1_P2)
            
#             if I1_P2 in H_reduced_subspace.keys():
#                 H_reduced_subspace[I1_P2] += rotated_Hcon[P]*p1
#             else:
#                 H_reduced_subspace[I1_P2] = rotated_Hcon[P]*p1
            
#         elif P[Z_index]== 'I':
#             H_reduced_subspace[P] = rotated_Hcon[P]
            
#         elif P[Z_index]!= 'I': 
#             sign=0 # MUST anti-commute!
#             H_reduced_subspace[P]=0
    
# #         # build reduced Hilbert Space
# #         if sign!=0:
# #             if P_new in H_reduced_subspace.keys():
# #                 H_reduced_subspace[P_new] = H_reduced_subspace[P_new] + rotated_Hcon[P]*sign
# #             else:
# #                 H_reduced_subspace[P_new] = rotated_Hcon[P_new]*sign
            
# # #     else:
# # #         H_reduced_subspace[P]=rotated_H[P]
H_reduced_subspace
nonCon_Energy = lowest_eigenvalue

H_con_subspace = conv_scr.Get_Operfermion_Hamiltonian(H_reduced_subspace)
sparseH_con_subspace = qubit_operator_sparse(H_con_subspace, n_qubits=hamiltonians[mol_key][1])
Con_Energy = sp.sparse.linalg.eigsh(sparseH_con_subspace, which='SA', k=1)[0][0]

Con_Energy+nonCon_Energy
FCI
c.quantum_correction(ham, #<- full Ham
                     model,
                     fn_form,
                     ground_state_params)
FCI-lowest_eigenvalue
Con_Energy
c.commute(P_gen, P)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11756476216265006, 'fraction_numerical': 0.01051538947558444, 'mean_word_length': 3.2039461202807815, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 90, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '23', 'dir': 'jupyter-structured-clean-dedup', 'id': '5626', 'license': 'MIT', 'n_tokens_mistral': 7841, 'n_tokens_neox': 7494, 'n_words': 1747, 'path': 'Projects/CS_VQE/jupyter_notebooks/CS-VQE notes.ipynb', 'repo_name': 'AlexisRalli/VQE-code', 'size': '22158'}