-
Notifications
You must be signed in to change notification settings - Fork 19
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
Enable user-defined MRSQK reference space #210
base: master
Are you sure you want to change the base?
Conversation
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.
Is the only goal of this PR to enable user-defined MRSQK reference spaces?
It seems to me that it's also trying to allow saving intermediates. Is this true? Is this PR trying to accomplish anything else?
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.
Thanks for the code. I have a few additional comments and questions.
@@ -126,6 +126,8 @@ def run(self, | |||
mr_dt=0.5, | |||
target_root=0, | |||
reference_generator='SRQK', | |||
refs_user_defined=None, | |||
save_qk_matrices=False, |
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.
Please include this keyword in the docstring.
@@ -178,9 +183,15 @@ def run(self, | |||
self.build_refs_from_srqk() | |||
|
|||
print('\n ==> SRQK reference selection complete.') | |||
|
|||
elif reference_generator.lower()=='user': |
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.
elif reference_generator.lower()=='user': | |
elif reference_generator.lower() == 'user': |
print('Trial reference state: ', ref_string(self._ref, self._nqb)) | ||
print('Trial state preparation method: ', self._state_prep_type) | ||
print('Reference space generator ', self._reference_generator.upper()) | ||
if(self._reference_generator.upper()=='SRQK'): |
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.
if(self._reference_generator.upper()=='SRQK'): | |
if self._reference_generator.upper()=='SRQK': |
@@ -424,15 +440,16 @@ def build_sa_qk_mats(self): | |||
|
|||
k = p+1 | |||
self._n_classical_params = k | |||
if(k==1): | |||
if(k==1) and (self._reference_generator != 'user'): |
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.
if(k==1) and (self._reference_generator != 'user'): | |
if k==1 and self._reference_generator != 'user': |
for i, csf in enumerate(refs_user_defined): | ||
print('\nRef ', i+1) |
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.
for i, csf in enumerate(refs_user_defined): | |
print('\nRef ', i+1) | |
for i, csf in enumerate(refs_user_defined, start=1): | |
print('\nRef ', i) |
if (self._print_summary_file): | ||
f.write(f' {scond:7.2e} {np.real(evals[self._target_root]):+15.9f} {self._n_classical_params:8} {self._n_cnot:10} {self._n_pauli_trm_measures:12}\n') | ||
|
||
if len(evals) > self._target_root: |
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.
Why is this line added?
@@ -60,6 +61,8 @@ def run(self, | |||
self._n_cnot = 0 | |||
self._n_pauli_trm_measures = 0 | |||
|
|||
self._save_qk_matrices = save_qk_matrices |
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.
My understanding is that nt_srqk
is called before the MRSQK. Is there a risk of MRSQK overwriting the saved QK files from here?
Description
Enable user to input a spin-adapted reference space for MRSQK calculations.
User Notes
.npz
file)Checklist