678 )
679
680 num_pure_d_shells = sum([1 for st in shell_types if st == 2])
681 num_pure_f_shells = sum([1 for st in shell_types if st == 3])682
683 _dump_integer_scalars("Number of basis functions", data.obasis.nbasis, f)
684 _dump_integer_scalars("Number of independent functions", data.obasis.nbasis, f)
677 "Call prepare_dump first."
678 )
679
680 num_pure_d_shells = sum([1 for st in shell_types if st == 2])681 num_pure_f_shells = sum([1 for st in shell_types if st == 3])
682
683 _dump_integer_scalars("Number of basis functions", data.obasis.nbasis, f)
598 expns = [shell.exponents[0] for shell in obasis.shells for _ in range(shell.nbasis)]
599 angmom_prim = {}
600 count = 1
601 for angmom in range(max([shell.angmoms[0] for shell in obasis.shells]) + 1):602 angmom_prim[angmom] = [count + i for i in range(len(obasis.conventions[angmom, "c"]))]
603 count += len(obasis.conventions[angmom, "c"])
604 types = [item for shell in obasis.shells for item in angmom_prim[shell.angmoms[0]]]
489 # write primitive types
490 angmom_prim = {}
491 count = 1
492 for angmom in range(max([shell.angmoms[0] for shell in obasis.shells]) + 1):493 angmom_prim[angmom] = [count + i for i in range(len(obasis.conventions[angmom, "c"]))]
494 count += len(obasis.conventions[angmom, "c"])
495 prim_types = [item for shell in obasis.shells for item in angmom_prim[shell.angmoms[0]]]
Using a container in place of a generator for a calls that can accept both, slows down the performance. Consider using generators for all function calls which accept both containers and genertors.
# List comprehension is unnecessary here
set([student.name for student in student])
sum([y**2 for y in list(range(10))])
set(student.name for student in students)
sum(y**2 for y in list(range(10)))