Skip to content

Commit

Permalink
RuCl migration of pyLIQTR-1.0 (#4)
Browse files Browse the repository at this point in the history
* RuCl migration of pyLIQTR-1.0

* deleted old RuCl notebook

* Fix Trotter printing, update pyproject.toml to use pyLIQTR 1.0.0, update gitignore

* updated notebook to take out unused imports and fix unused colors issue

* structured RuCl notebook to use qca package, fixed plot_T_histogram header in qca.utils.utils

* removed unused functs and imports, changed the plot_histogram funct in qca, and reverted some previous changes, fixed plotting, changed assign_labels to allow generic x y z labels

* added default args to assign_hexagon_labels, removed the commented code for  plotting for qsp, made the labels uppercase

---------

Co-authored-by: Zain Mughal <zain@pn2401319.lanl.gov>
Co-authored-by: Zachary Alexander Morrell <zmorrell@lanl.gov>
  • Loading branch information
3 people authored Mar 4, 2024
1 parent 36246ff commit de442b5
Show file tree
Hide file tree
Showing 5 changed files with 1,038 additions and 1,106 deletions.
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

0 comments on commit de442b5

Please sign in to comment.