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

Hot Fix: RuCl Application 2: GSEE #67

Merged
merged 14 commits into from
Jan 10, 2025
Merged

Hot Fix: RuCl Application 2: GSEE #67

merged 14 commits into from
Jan 10, 2025

Conversation

zain2864
Copy link
Collaborator

@zain2864 zain2864 commented Jan 7, 2025

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.

@zain2864 zain2864 added the bug Something isn't working label Jan 7, 2025
@zain2864 zain2864 requested review from gsgrattan and JonhasSC January 7, 2025 05:25
@gsgrattan
Copy link
Collaborator

No Issues here

@@ -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)
Copy link
Collaborator

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

Copy link
Collaborator Author

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

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}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gsee not qsee

Copy link
Collaborator Author

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

@@ -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/'
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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)
Copy link
Collaborator

@JonhasSC JonhasSC Jan 9, 2025

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@JonhasSC JonhasSC Jan 10, 2025

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.

Copy link
Collaborator

@JonhasSC JonhasSC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zain2864 zain2864 merged commit cc16f71 into dev Jan 10, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants