@@ -906,3 +906,89 @@ def random_noise(a):
906906 step_runtime = step_runtime ,
907907 best_run = best_run ,
908908 )
909+
910+
911+ def optimize_peps_unitcell (
912+ unitcell ,
913+ expectation_func ,
914+ autosave_filename = "data/autosave.hdf5" ,
915+ slurm_restart_script = None ,
916+ ):
917+ return optimize_peps_network (
918+ unitcell ,
919+ expectation_func ,
920+ autosave_filename = autosave_filename ,
921+ slurm_restart_script = slurm_restart_script ,
922+ )
923+
924+
925+ def optimize_unitcell_fixed_spiral_vector (
926+ unitcell ,
927+ spiral_vector ,
928+ expectation_func ,
929+ autosave_filename = "data/autosave.hdf5" ,
930+ slurm_restart_script = None ,
931+ ):
932+ return optimize_peps_network (
933+ unitcell ,
934+ expectation_func ,
935+ additional_input = {"spiral_vectors" : spiral_vector },
936+ autosave_filename = autosave_filename ,
937+ slurm_restart_script = slurm_restart_script ,
938+ )
939+
940+
941+ def _map_spiral_func (input_tensors , generate_unitcell ):
942+ return input_tensors [:1 ], input_tensors [1 :]
943+
944+
945+ def optimize_unitcell_full_spiral_vector (
946+ unitcell ,
947+ spiral_vector ,
948+ expectation_func ,
949+ autosave_filename = "data/autosave.hdf5" ,
950+ slurm_restart_script = None ,
951+ ):
952+ return optimize_peps_network (
953+ (unitcell , spiral_vector ),
954+ expectation_func ,
955+ _map_spiral_func ,
956+ autosave_filename = autosave_filename ,
957+ slurm_restart_script = slurm_restart_script ,
958+ )
959+
960+
961+ def optimize_unitcell_spiral_vector_x_component (
962+ unitcell ,
963+ spiral_vector_x ,
964+ spiral_vector_fixed_y ,
965+ expectation_func ,
966+ autosave_filename = "data/autosave.hdf5" ,
967+ slurm_restart_script = None ,
968+ ):
969+ return optimize_peps_network (
970+ (unitcell , spiral_vector_x ),
971+ expectation_func ,
972+ _map_spiral_func ,
973+ additional_input = {"spiral_vectors_y" : spiral_vector_fixed_y },
974+ autosave_filename = autosave_filename ,
975+ slurm_restart_script = slurm_restart_script ,
976+ )
977+
978+
979+ def optimize_unitcell_spiral_vector_y_component (
980+ unitcell ,
981+ spiral_vector_fixed_x ,
982+ spiral_vector_y ,
983+ expectation_func ,
984+ autosave_filename = "data/autosave.hdf5" ,
985+ slurm_restart_script = None ,
986+ ):
987+ return optimize_peps_network (
988+ (unitcell , spiral_vector_y ),
989+ expectation_func ,
990+ _map_spiral_func ,
991+ additional_input = {"spiral_vectors_x" : spiral_vector_fixed_x },
992+ autosave_filename = autosave_filename ,
993+ slurm_restart_script = slurm_restart_script ,
994+ )
0 commit comments