Polymer System🔗
Base class for the overall method. Includes function for computing density and the system state is stored in this object.
Usage notes:
N will be set by default to the longest length scale of the system, which may be undesirable depending on how other parameters are scaled.
Attributes:
| Name | Type | Description |
|---|---|---|
n_species |
int
|
Number of monomer species in simulation \(M\). |
integration_width |
float
|
Maximum integration width along the polymer \(\Delta s\). |
FH_dict |
dict
|
Dict of |
polymers |
tuple
|
List of Polymer objects representing all polymers in the system. \(\{P\}\). |
poly_dict |
dict
|
Dict of Polymer objects representing the amount of each polymer. in solution \(\{p_i \rightarrow C_{p_i}\}\). |
solvent_dict |
dict
|
Dict of Monomer objects representing the amount of each solvent. species in solution \(\{S_i \rightarrow C_{S_i}\}\). |
Q_dict |
dict
|
Stores the partition functions for each polymer and monomer during the density collection step \(\{P_i/S_i \rightarrow Q_j\}\). |
dQ_dV_dict |
dict
|
Stores dQ/dV values of each polymer and monomer for pressure calculations \(\{P_i/S_i \rightarrow \frac{\partial Q_j}{\partial V}\}\). |
FH_matrix |
ndarray
|
Flory-Huggins matrix representing the interaction potentials between all species \(\boldsymbol{\chi} N\). |
grid |
Grid
|
Grid object for the simulation. |
w_all |
ndarray
|
Stacked, complex arrays representing the chemical potential field for each monomer species at every grid point in the real density representation. \(\boldsymbol{b}\boldsymbol{\mu}(\boldsymbol{r})\) |
normal_w |
ndarray
|
Stacked, complex arrays representing the chemical potential field at each grid point for fields in the normal mode representation. \(\{\mu_i(\boldsymbol{r})\}\) |
w_all_smeared |
ndarray
|
Stacked, smeared, complex arrays created when we need to change the basis out
of |
psi |
ndarray
|
Complex array representing the electrostatic potential at each grid. point \(\varphi(\boldsymbol{r})\). |
smear_arr |
ndarray
|
Array of smearing constant for the simulation where the index corresponds to the same indexed field \(\{\alpha_i\}\). Feature is still experimental, has not been rigorously tested for non-uniform arrays. If array is uniform, system has a single smearing constant. |
psi_smear |
float
|
Smearing constant for electric charge \(\alpha_{\varphi}\). |
monomers |
tuple
|
All monomer types in system with fixed ordering for proper indexing \(\{m\}\). |
red_FH_mat |
ndarray
|
FH matrix with degenerate modes removed. |
degen_dict |
dict
|
Dictionary mapping the identical species in the non-degenerate representation to their equivalents in the degenerate representation \(\{\{m\}_{degen} \rightarrow i\}\). |
rev_degen_dict |
dict
|
Dict listing the indices of species in the non-degenerate representation given their degenerate representation \(\{i \rightarrow \{m\}_{degen}\}\). |
normal_evalues |
ndarray
|
CuPy Array of floats representing the eigenvalues of the normal mode decomposition \(\{B_i\}\). |
normal_modes |
ndaray
|
Same as normal modes. Plan to deprecate. |
A_ij |
ndarray
|
CuPy Array of floats representing the matrix of eigenvalues of the normal mode decomposition, notated \(\boldsymbol{b}\) (sometimes \(A_{ij}\)). |
A_inv |
ndarray
|
Inverse of A_ij, notated \(\boldsymbol{b}^{-1}\). |
gamma |
ndarray
|
Complex vector indexed as normal_evalues, entries are 1 eigenvalues is less than 0 and \(i\) for eigenvalues greater than 0, notaed \(\gamma_i\). |
phi_all |
ndarray
|
Complex density of each monomer species at every grid point in the real density representation, uses standard monomer indexing, notated \(\{\rho_i\}\). |
phi_salt |
ndarray
|
Density of each salt species at every grid point in the real density. Only active when using volume-less, non-FH interacting salts. |
salts |
tuple or None
|
Tuple containing salt |
salt_concs |
dict
|
A dictionary mapping salt |
salt_pos |
Monomer or None
|
Generic, non-FH interacting positive salt monomer, if it exists |
salt_neg |
Monomer or None
|
Generic, non-FH interacting negative salt monomer, if it exists |
has_nanps |
bool
|
True if there are nanoparticles in the system. |
nanps |
Tuple or None
|
List of nanoparticle species if they exist |
N |
float
|
Characteristic length \(N\) of the system. By default set to the longest polymer in the system. Choice is material, if two systems are to be directly compared this value needs to be the same between them or many corrections need to be made. Rescales entire system. |
use_salts |
bool
|
True if there are volume-less, non-FH salts in the system. |
ordered_spec |
tuple
|
Tuple of species in the order they are stored in the density matrix. |
c_s |
float
|
Total salt concentration. |
chem_pot_dict |
(dict, optional)
|
A dictionary mapping each species object to its calculated chemical
potential. This attribute is only
set by the |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
monomers
|
list
|
List of monomer species \(\{m\}\). System will generally reorder them to put the solvents last, but interactions will be correct. |
required |
polymers
|
list
|
List of polymer species \(\{P\}\). |
required |
spec_dict
|
dict
|
Dict listing the amount of each polymer and solvent species in solution \(\{p_i/S_i \rightarrow C_{i}\}\). |
required |
FH_dict
|
dict
|
Dict corresponding a frozenset for each pair of monomers and their FH interaction term. |
required |
grid
|
Grid
|
Grid object for the simulation. |
required |
smear
|
Union[float, ndarray]
|
Gaussian smearing constant, or array of constants \(\alpha\) or \(\{\alpha\}\). Arrays correspond to different species, but this method is still experimental. |
required |
psi_smear
|
float
|
If provided gives the electrostatic smearing constant \(\alpha_{\varphi}\) |
0
|
salt_conc
|
float
|
Total salt concentration, default 0.0. Salts added here will not interact except via the charge field and will automatically balance the charge of the system. |
0.0
|
integration_width
|
float
|
Maximum integration width \(\Delta s\), default 0.2. Defined as fraction of \(N\). |
0.2
|
custom_salts
|
tuple
|
List of salt species, default None leads to salts with charge \(\pm1\). Still experimental. |
None
|
nanoparticles
|
tuple
|
List of nanoparticle species, default None. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
Raised if there is a species that is not a polymer or monomer in the species dictionary. |
Source code in polycomp/ft_system.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 | |
Functions🔗
assign_normals() -> None
🔗
Assigns the normal eigenvalues and eigenvectors
Takes a non-degenerate FH matrix and generates the corresponding normal mode decomposition factors of A_ij and eigenvalues.
Updates the following attributes:
self.normal_evaluesself.normal_modesself.A_ijself.A_inv
Source code in polycomp/ft_system.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
convolve(array: cp.ndarray, kernel_k: cp.ndarray) -> cp.ndarray
🔗
Convolve any array with a given kernel.
The kernel is in k-space, and the array is in real space, uses a cupy C kernel for performance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array
|
ndarray
|
Real space array to be convolved. |
required |
kernel_k
|
ndarray
|
Kernel of the same last dimensions in k-space. |
required |
Returns:
| Type | Description |
|---|---|
conv
|
Convolution of the array and kernel. |
Source code in polycomp/ft_system.py
740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 | |
dens_from_norm_generic_smeared(field_array: cp.ndarray, kernel_array: cp.ndarray) -> cp.ndarray
🔗
Generic version of update_density_from_normal_smeared that can apply any
smearing kernel to any appropriately shaped array and make the basis transform.
Currently only used to update the desnities when computing the pressure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kernel_array
|
ndarray
|
Array with shape like FH x dims. |
required |
field_array
|
ndarray
|
Array with shape like |
required |
Returns:
| Name | Type | Description |
|---|---|---|
out_array |
ndarray
|
|
Source code in polycomp/ft_system.py
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | |
find_degeneracy() -> None
🔗
Updates and combines species with identical FH interactions. Singular matrices cause problems, so all degenerate species need to be combined for the purposes of writing the normal basis. This function identifies and combines trivial degenerate species, and then creates the dictionaries needed to map in and out of the non-degenerate representation.
The matrix may still be singular after calling this method if there are non-trivial degeneracies. Currently such a system cannot be simulated in this codebase and this will return an error.
Updates the following attributes:
self.red_FH_matself.degen_dictself.rev_degen_dict
Raises:
| Type | Description |
|---|---|
ValueError
|
If the degeneracy cannot be reduced (usually caused by more complicated degeneracies than just identical FH parameters). |
Source code in polycomp/ft_system.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |
gaussian_smear(array: cp.ndarray, alpha: float) -> cp.ndarray
🔗
Smear an array by a Gaussian pseudospectrally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array
|
ndarray
|
Array to be smeared. |
required |
alpha
|
float
|
Variance of Gaussian to be smeared by. |
required |
Returns:
| Type | Description |
|---|---|
array_r
|
Smeared array |
Source code in polycomp/ft_system.py
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | |
get_densities(for_pressure: bool = False) -> None
🔗
Function to get the densities from a given set of potentials.
Uses all of the configurations in the polysystem to determine the integration scheme. By default will compute for a continuous gaussian chain with an effective trapezoid integrator, can be configured for a discrete chain. Expensive function, calls should be minimized. Pressure increases expense.
Updates the following attributes:
self.phi_allself.dQ_dV_dictself.Q_dict
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
for_pressure
|
bool
|
Whether there is a pressure calculation planned before another call of this function. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
Raised if \(Q_p(s)\) is not the same for all points along the polymer. This is usually the case because either there is something wrong with the integration plan or the fields have gone unstable and achieved unphysical values. Constraint has been relaxed somewhat because structures can transiently violate this rule. |
Source code in polycomp/ft_system.py
872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 | |
get_gamma() -> None
🔗
Examines eigenvalues and assigns the correct values to gamma based on their sign.
Updates the following attributes:
self.gamma
Source code in polycomp/ft_system.py
513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 | |
get_net_saltless_charge() -> float
🔗
Get the net charge of the system without non-FH salt species.
Returns:
| Type | Description |
|---|---|
total_charge
|
Net charge of the system |
Source code in polycomp/ft_system.py
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 | |
get_salt_concs() -> None
🔗
Computes and assigns the non-FH salt concentrations needed to maintain charge balance.
Updates the following attributes:
self.salt_concs
Raises:
| Type | Description |
|---|---|
ValueError
|
Raised if the amount of total salt is not enough to correct the charge imbalance. |
Source code in polycomp/ft_system.py
1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 | |
get_total_charge(include_salt: bool = True) -> cp.ndarray
🔗
Get the total charge of the system at every point in space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_salt
|
bool
|
Whether to include salt in the total charge |
True
|
Returns:
| Type | Description |
|---|---|
total_charge
|
Array of net charge of the system as a function of space |
Source code in polycomp/ft_system.py
844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 | |
laplacian(array: cp.ndarray) -> cp.ndarray
🔗
Compute the laplacian or a spatial array on the grid pseudospectrally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array
|
ndarray
|
Array for which the laplician will be taken |
required |
Returns:
| Type | Description |
|---|---|
lap_array
|
Laplacian of the input array |
Source code in polycomp/ft_system.py
805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 | |
map_dens_from_norm(w_like_array: cp.ndarray) -> cp.ndarray
🔗
Map any input array from real density to normal representation.
The first axis of w_like_array must be shaped like w_all's first axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w_like_array
|
ndarray
|
Array in real density space to be transformed. |
required |
Returns:
| Type | Description |
|---|---|
new_array
|
Array of input in the normal basis. |
Source code in polycomp/ft_system.py
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 | |
map_norm_from_dens(w_like_array: cp.ndarray) -> cp.ndarray
🔗
Map any array from normal to real density representation.
The first axis of w_like_array must be shaped like w_all's first axis. Does not apply any smearing transform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w_like_array
|
ndarray
|
Array in density space to be transformed. |
required |
Returns:
| Type | Description |
|---|---|
new_array
|
Array in normal space after basis transform. |
Source code in polycomp/ft_system.py
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | |
map_norm_from_dens_smeared(w_like_array: cp.ndarray) -> cp.ndarray
🔗
Maps the input array in the normal basis into the density basis and accounts for smearing which may have to occur synchronously with the basis transform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w_like_array
|
ndarray
|
Array with the same structure as the normal basis chemical potential field |
required |
Returns:
| Type | Description |
|---|---|
smeared_output
|
Equivalent array in the density basis with smearing |
Source code in polycomp/ft_system.py
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 | |
randomize_array(array: cp.ndarray, noise: float) -> cp.ndarray
🔗
Generates a random valued array in the same shape as the input array.
Noise is Gaussian distributed around zero with a variance of noise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array
|
ndarray
|
Array used to determine the shape of the output noise. |
required |
noise
|
float
|
Variance of desired noise. |
required |
Returns:
| Type | Description |
|---|---|
array_out
|
Output array with random noise in the specified configuration. |
Source code in polycomp/ft_system.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 | |
reduce_phi_all(phi_all: cp.ndarray) -> cp.ndarray
🔗
Converts an array with information about the density of all the species into an equivalent array where species with identical FH interactions have been summed over.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
phi_all
|
ndarray
|
Array like |
required |
Returns:
| Name | Type | Description |
|---|---|---|
red_phi_all |
ndarray
|
Equivalent array with degenerate density combined and indexing matching
|
Source code in polycomp/ft_system.py
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 | |
reindex_Q_c(Q_c: cp.ndarray) -> cp.ndarray
🔗
Function to reindex Q_c to correctly handle edges of polymers.
Because the integration takes place over the polymer beads but the values are recorded at the joints, we need to reindex the joints back to the beads. Currently only implements a trapezoid-rule like integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Q_c
|
ndarray
|
\(Q(s)\) with a shape that is associated with the joints. |
required |
Returns:
| Type | Description |
|---|---|
new_Q_c
|
\(Q(s)\) one segment shorter than the input, with summation consistent with a continuous Gaussian chain. |
Source code in polycomp/ft_system.py
1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 | |
remove_degeneracy(array: cp.ndarray) -> cp.ndarray
🔗
This function sums over degenerate elements.
This is called external to the function when an external method needs the reduced representation and allows access to the non-degenerate version of any appropriately shaped array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
array
|
ndarray
|
Array like w_all to have degenerate elements summed over. Must be ordered the same way as w_all. |
required |
Source code in polycomp/ft_system.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
set_monomer_order(monomers: list) -> None
🔗
Permanently affixes the order of the monomers.
Orders the monomers so that solvents tend to be last and then writes them into a tuple.
Updates the following attributes:
self.monomers
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
monomers
|
list
|
Monomer objects to be ordered. |
required |
Source code in polycomp/ft_system.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | |
update_density_from_normal() -> None
🔗
Updates self.w_all to match the current state of self.normal_w. If the
normal basis has been updated and is in the correct state this function should
be called so the entire system has the correct values. Does not account for
smearing.
Updates the following attributes:
self.w_all
Source code in polycomp/ft_system.py
576 577 578 579 580 581 582 583 584 585 586 587 588 | |
update_density_from_normal_smeared() -> None
🔗
Updates self.w_all to match the current state of self.normal_w accounting
for the smearing of all different fields. If
normal basis has been updated and is in the correct state this function should
be called so the entire system has the correct values. Usually this should be
called over update_density_from_normal, and is mandatory if there are
different smearing length scales as the smearing must happen before the change
of basis.
Updates the following attributes:
self.w_all
Source code in polycomp/ft_system.py
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 | |
update_normal_from_density() -> None
🔗
Updates self.noram_w to match the current state of self.w_all. If the
density basis has been updated and is in the correct state this function should
be called so the entire system has the correct values. Does not account for
smearing.
Updates the following attributes:
self.normal_w
Source code in polycomp/ft_system.py
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 | |