|
22 | 22 | from sire.system import System as _System
|
23 | 23 | from sire.legacy.System import System as _LegacySystem
|
24 | 24 |
|
25 |
| -import sire.legacy.CAS as _SireCAS |
26 | 25 | import sire.legacy.MM as _SireMM
|
27 | 26 | import sire.legacy.Mol as _SireMol
|
28 | 27 |
|
@@ -244,12 +243,9 @@ def _make_compatible(system):
|
244 | 243 | initial_dummy = _has_dummy(mol, [idx0, idx1, idx2])
|
245 | 244 | final_dummy = _has_dummy(mol, [idx0, idx1, idx2], True)
|
246 | 245 |
|
247 |
| - # If both end states contain a dummy, the use null potentials. |
| 246 | + # If both end states contain a dummy, then don't add the potentials. |
248 | 247 | if initial_dummy and final_dummy:
|
249 |
| - theta = _SireCAS.Symbol("theta") |
250 |
| - null_angle = _SireMM.AmberAngle(0.0, theta).to_expression(theta) |
251 |
| - new_angles0.set(idx0, idx1, idx2, null_angle) |
252 |
| - new_angles1.set(idx0, idx1, idx2, null_angle) |
| 248 | + continue |
253 | 249 | # If the initial state contains a dummy, then use the potential from the final state.
|
254 | 250 | # This should already be the case, but we explicitly set it here.
|
255 | 251 | elif initial_dummy:
|
@@ -355,34 +351,25 @@ def _make_compatible(system):
|
355 | 351 | all_dummy_initial = all(_is_dummy(mol, [idx0, idx1, idx2, idx3]))
|
356 | 352 | all_dummy_final = all(_is_dummy(mol, [idx0, idx1, idx2, idx3], True))
|
357 | 353 |
|
358 |
| - # If both end states contain a dummy, the use null potentials. |
| 354 | + # If both end states contain a dummy, then don't add the potentials. |
359 | 355 | if has_dummy_initial and has_dummy_final:
|
360 |
| - phi = _SireCAS.Symbol("phi") |
361 |
| - null_dihedral = _SireMM.AmberDihedral(0.0, phi).to_expression(phi) |
362 |
| - new_dihedrals0.set(idx0, idx1, idx2, idx3, null_dihedral) |
363 |
| - new_dihedrals1.set(idx0, idx1, idx2, idx3, null_dihedral) |
| 356 | + continue |
364 | 357 | elif has_dummy_initial:
|
365 | 358 | # If all the atoms are dummy, then use the potential from the final state.
|
366 | 359 | if all_dummy_initial:
|
367 | 360 | new_dihedrals0.set(idx0, idx1, idx2, idx3, p1.function())
|
368 | 361 | new_dihedrals1.set(idx0, idx1, idx2, idx3, p1.function())
|
369 |
| - # Otherwise, zero the potential. |
| 362 | + # Otherwise, remove the potential from the initial state. |
370 | 363 | else:
|
371 |
| - phi = _SireCAS.Symbol("phi") |
372 |
| - null_dihedral = _SireMM.AmberDihedral(0.0, phi).to_expression(phi) |
373 |
| - new_dihedrals0.set(idx0, idx1, idx2, idx3, null_dihedral) |
374 | 364 | new_dihedrals1.set(idx0, idx1, idx2, idx3, p1.function())
|
375 | 365 | elif has_dummy_final:
|
376 | 366 | # If all the atoms are dummy, then use the potential from the initial state.
|
377 | 367 | if all_dummy_final:
|
378 | 368 | new_dihedrals0.set(idx0, idx1, idx2, idx3, p0.function())
|
379 | 369 | new_dihedrals1.set(idx0, idx1, idx2, idx3, p0.function())
|
380 |
| - # Otherwise, zero the potential. |
| 370 | + # Otherwise, remove the potential from the final state. |
381 | 371 | else:
|
382 |
| - phi = _SireCAS.Symbol("phi") |
383 |
| - null_dihedral = _SireMM.AmberDihedral(0.0, phi).to_expression(phi) |
384 | 372 | new_dihedrals0.set(idx0, idx1, idx2, idx3, p0.function())
|
385 |
| - new_dihedrals1.set(idx0, idx1, idx2, idx3, null_dihedral) |
386 | 373 | else:
|
387 | 374 | new_dihedrals0.set(idx0, idx1, idx2, idx3, p0.function())
|
388 | 375 | new_dihedrals1.set(idx0, idx1, idx2, idx3, p1.function())
|
@@ -490,33 +477,25 @@ def _make_compatible(system):
|
490 | 477 | all_dummy_initial = all(_is_dummy(mol, [idx0, idx1, idx2, idx3]))
|
491 | 478 | all_dummy_final = all(_is_dummy(mol, [idx0, idx1, idx2, idx3], True))
|
492 | 479 |
|
| 480 | + # If both end states contain a dummy, then don't add the potentials. |
493 | 481 | if has_dummy_initial and has_dummy_final:
|
494 |
| - phi = _SireCAS.Symbol("phi") |
495 |
| - null_dihedral = _SireMM.AmberDihedral(0.0, phi).to_expression(phi) |
496 |
| - new_impropers0.set(idx0, idx1, idx2, idx3, null_dihedral) |
497 |
| - new_impropers1.set(idx0, idx1, idx2, idx3, null_dihedral) |
| 482 | + continue |
498 | 483 | elif has_dummy_initial:
|
499 | 484 | # If all the atoms are dummy, then use the potential from the final state.
|
500 | 485 | if all_dummy_initial:
|
501 | 486 | new_impropers0.set(idx0, idx1, idx2, idx3, p1.function())
|
502 | 487 | new_impropers1.set(idx0, idx1, idx2, idx3, p1.function())
|
503 |
| - # Otherwise, zero the potential. |
| 488 | + # Otherwise, remove the potential from the initial state. |
504 | 489 | else:
|
505 |
| - phi = _SireCAS.Symbol("phi") |
506 |
| - null_dihedral = _SireMM.AmberDihedral(0.0, phi).to_expression(phi) |
507 |
| - new_impropers0.set(idx0, idx1, idx2, idx3, null_dihedral) |
508 | 490 | new_impropers1.set(idx0, idx1, idx2, idx3, p1.function())
|
509 | 491 | elif has_dummy_final:
|
510 | 492 | # If all the atoms are dummy, then use the potential from the initial state.
|
511 | 493 | if all_dummy_final:
|
512 | 494 | new_impropers0.set(idx0, idx1, idx2, idx3, p0.function())
|
513 | 495 | new_impropers1.set(idx0, idx1, idx2, idx3, p0.function())
|
514 |
| - # Otherwise, zero the potential. |
| 496 | + # Otherwise, remove the potential from the final state. |
515 | 497 | else:
|
516 |
| - phi = _SireCAS.Symbol("phi") |
517 |
| - null_dihedral = _SireMM.AmberDihedral(0.0, phi).to_expression(phi) |
518 | 498 | new_impropers0.set(idx0, idx1, idx2, idx3, p0.function())
|
519 |
| - new_impropers1.set(idx0, idx1, idx2, idx3, null_dihedral) |
520 | 499 | else:
|
521 | 500 | new_impropers0.set(idx0, idx1, idx2, idx3, p0.function())
|
522 | 501 | new_impropers1.set(idx0, idx1, idx2, idx3, p1.function())
|
|
0 commit comments