-
Notifications
You must be signed in to change notification settings - Fork 2
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
Hot Fix: RuCl Application 2: GSEE #67
Conversation
…csv file, and upgrade pyliqtr version req
No Issues here |
scripts/RuCl-RE.py
Outdated
@@ -295,7 +294,12 @@ def generate_rucl_gsee_re( | |||
gate_synth_accuracy = 10 | |||
trotter_order = 2 | |||
is_extrapolated=True | |||
init_state = [0] * lattice_size * lattice_size * 2 #TODO: use DMRG as initial state prep | |||
|
|||
graph = hexagonal_lattice_graph(lattice_size,lattice_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove copied code, as this is just introducing something else to maintain that is already implemented. clean up functions to just be able to construct the graph and extract the initial state from, and then also be used to construct the hamiltonian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is has been done, now there is a new function to build the RuCl graph, and the gsee init state is also handled by another function. The code has been cleaned to use these functions
scripts/RuCl-RE.py
Outdated
nsteps=nsteps, | ||
gsee_args=gsee_args, | ||
init_state=init_state, | ||
precision_order=1, | ||
bits_precision=bits_precision, | ||
phase_offset=phase_offset, | ||
metadata = gsee_metadata | ||
metadata = gsee_metadata, | ||
circuit_name = f'qsee_rucl_size_{lattice_size}_row_{rucl_idx}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gsee not qsee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to add this, will do so after generating pdf
scripts/RuCl-RE.py
Outdated
@@ -359,7 +364,7 @@ def rucl_estimate(): | |||
df_rucl = pd.read_csv(f"{RuCl_csv_directory}RuCl_test_input.csv") | |||
|
|||
if args.mode == 'dynamics': | |||
re_dir = 'temp_RE/Dynamics/' | |||
re_dir = 'RuCl_RE/Dynamics/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardcoded outdir, modify to use user supplied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
notebooks/RuClExample.ipynb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- lattice variable be renamed to lattice_size
- remove copied code that you did the same way in script. clean up and use it here also
- put gsee args definitions for GSEE outside of loop, e.g, bits_precision, trotter_order, trotter_steps, lattice_size
- fix initial state block, same as second comment
- pass in lattice size and column idx into circuit name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
scripts/RuCl-RE.py
Outdated
return init_state | ||
|
||
def generate_rucl_hamiltonian(lattice_size, data_series, s=0, field_x=lambda s: 0, field_y=lambda s: 0, field_z=lambda s: 0): | ||
graph = build_rucl_graph(lattice_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are still building the graph twice. You do so by building the actual graph, and another when extracting the initial state. Since you build the graph, you don't need a function to extract the initial state. Just doing init_state = [0] * len(graph.nodes) with the reference to the already built graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
notebooks/RuClExample.ipynb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
improper generate_rucl_hamiltonian function call. Did not modify call to account for new function signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR makes necessary changes needed to run RuCl Application 2: GSEE correctly. This fix changes the initial state that was previously used for GSEE, and now takes into account the Hexagonal Lattice structure. In addition, some inputs for GSEE are corrected, so the RE files are not overwritten. This is fixed for both the RuClExample notebook and RuCl-RE.py script. The input data csv file for the script was updated to take out spaces, which had caused some entries to be missed. The requirements.txt file was updated to use the latest PyLIQTR release (1.3.4). All that is left is to update the pdf of the RuClExample notebook.