Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuCl migration of pyLIQTR-1.0 #4

Merged
merged 8 commits into from
Mar 4, 2024
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Trotter/*
notebooks/Trotter/*
QSP/*
notebooks/QSP/*
.ipynb*
*.sh
GSE/*
notebooks/GSE/*
*.zip
qasm_circuits/*

Expand Down
1,069 changes: 0 additions & 1,069 deletions RuClExample.ipynb

This file was deleted.

75 changes: 42 additions & 33 deletions notebooks/MagneticLattices.ipynb

Large diffs are not rendered by default.

989 changes: 989 additions & 0 deletions notebooks/RuClExample.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/qca/utils/hamiltonian_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def pyliqtr_hamiltonian_to_openfermion_qubit_operator(H:Hamiltonian) -> QubitOpe
open_fermion_operator += term[1] * open_fermion_term_op
return open_fermion_operator

def assign_hexagon_labels(graph:Graph):
def assign_hexagon_labels(graph:Graph, x:str='X', y:str='Y', z:str='Z'):
for n1, n2 in graph.edges:
# start by making sure that the edges are ordered correctly
r1,c1 = n1
Expand All @@ -200,12 +200,12 @@ def assign_hexagon_labels(graph:Graph):
# now that they are ordered correctly, we can assign labels
label = ''
if c1 == c2:
label = 'Z'
label = z
# You can differentiate X and Y labels based off nx's node label parity
elif (((r1 % 2) + (c1 % 2)) % 2 == 0):
label = 'Y'
label = y
else:
label = 'X'
label = x

graph[n1][n2]['label'] = label

Expand Down