Skip to content
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

Feature bond breaking #111

Merged
merged 45 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
af04346
Added support for using the Andersen thermostat instead of an integrator
chryswoods Sep 19, 2023
2f0ea73
Added the intramolecular scale factors to the LambdaLever. This shoul…
chryswoods Sep 20, 2023
d9cd2ad
I've moved the messiness of the perturbable parts of OpenMMMolecule i…
chryswoods Sep 20, 2023
72fb319
Working on the tutorial, filling in missing or confusing functionalit…
chryswoods Sep 21, 2023
3e5522b
Continuing to work on the tutorial
chryswoods Sep 21, 2023
c4582e7
Finished writing the tutorial docs for the new perturbation code. All…
chryswoods Sep 21, 2023
a52e54a
Working on a way to get energy trajectory output that is more compati…
chryswoods Sep 22, 2023
5690220
Made sure that we match dihedrals by atoms AND periodicity, so that w…
chryswoods Sep 22, 2023
18d75e4
Fixed printout of the temperature of an ensemble
chryswoods Sep 26, 2023
51cc0ec
Updated EnergyTrajectory so that it can output labels as numbers, and…
chryswoods Sep 26, 2023
efb219c
Working on the free energy simulation tutorial page. This shows how t…
chryswoods Sep 26, 2023
f30854c
Quick note that we don't really need parquet
chryswoods Sep 26, 2023
d10ea02
Make sure that we don't record energies / frames when the update freq…
chryswoods Sep 27, 2023
46b0364
I've finished off the tutorial on calculating and analysing free ener…
chryswoods Sep 28, 2023
620afa7
Fixed some small typos in the tutorial
chryswoods Sep 28, 2023
a37bc32
Added an option to constrain the perturbable molecules using a differ…
chryswoods Oct 1, 2023
062703f
I've added a `sire.morph.repartition_hydrogen_masses` function (with …
chryswoods Oct 2, 2023
6ccc3da
Added functions to let the user easily set the temperature and/or pre…
chryswoods Oct 2, 2023
b708fa6
Switched repartition_hydrogen_masses over to using the C++ function
Oct 3, 2023
56d079b
Continuing to work on the tutorial...
Oct 3, 2023
bec7fd0
Still working on the last part of the tutorial.
chryswoods Oct 3, 2023
fae4597
Added the option to control whether or not the internal energy/forces…
Oct 4, 2023
8ba1ccc
Need to make sure that HMR repartitions the masses in both end states…
chryswoods Oct 5, 2023
4eb4822
Working on speeding things up
chryswoods Oct 5, 2023
6c68751
Added the ability to store the ensemble (and thus temperature) in the…
chryswoods Oct 6, 2023
fafe084
I've changed the default hydrogen mass repartitioning (HMR) factor fr…
chryswoods Oct 6, 2023
6b878fc
Fixed some typos and added the results of running the script to the e…
chryswoods Oct 6, 2023
ca287bb
Finished the free energy tutorial with the results from the long simu…
chryswoods Oct 7, 2023
380b687
Merge branch 'devel' of https://github.com/openbiosim/sire into featu…
chryswoods Oct 7, 2023
2ba8870
Updated the changelog. Added the pentane to cyclopentane test, and al…
chryswoods Oct 7, 2023
389b08e
Merge branch 'feature_tag_build' of https://github.com/openbiosim/sir…
chryswoods Oct 7, 2023
59be915
Merge branch 'devel' of https://github.com/openbiosim/sire into featu…
chryswoods Oct 7, 2023
7b11ffc
Small corrections
chryswoods Oct 7, 2023
5d79574
Got the bond-breaking molecule to load into OpenMM by realising that …
chryswoods Oct 7, 2023
23a4b25
Fixed the typo-bug in openmmmolecule.cpp that was stopping bond break…
chryswoods Oct 7, 2023
d8f0baa
I think this fixes the compile error on Windows (missing definition o…
chryswoods Oct 7, 2023
a78f9a6
Website-only updates. Updated the changelog, added free energy to the…
chryswoods Oct 7, 2023
94e8db7
Possible fix for the windows link error.
chryswoods Oct 7, 2023
67c7b02
Need to add back this header file to compile on MacOS
chryswoods Oct 7, 2023
2c381df
Another Windows compile fix. I think these have all come up because b…
chryswoods Oct 7, 2023
e52dd84
Fix needed for Linux...
chryswoods Oct 7, 2023
d8e442e
Disabling unsupported tests on windows
chryswoods Oct 8, 2023
bab4508
Copilot got that wrong...
chryswoods Oct 8, 2023
d807395
Cleaning up the website ready for the release. Moved the blog posts i…
chryswoods Oct 8, 2023
7599bba
Dynamics.energy_trajectory should not default to the pandas output
chryswoods Oct 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ To create a new environment:

mamba create -n openbiosim "python<3.11"
mamba activate openbiosim
mamba install -c openbiosim sire
mamba install -c conda-forge -c openbiosim sire

To install the latest development version you can use:

.. code-block:: bash

mamba create -n openbiosim-dev "python<3.11"
mamba activate openbiosim-dev
mamba install -c openbiosim/label/dev sire
mamba install -c conda-forge -c openbiosim/label/dev sire

However, as you are here, it is likely you want to download the latest,
greatest version of the code, which you will need to compile. To compile
Expand Down
38 changes: 31 additions & 7 deletions corelib/src/libs/SireCAS/lambdaschedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,23 @@ void LambdaSchedule::clear()
this->constant_values = Values();
}

/** Append a morph stage onto this schedule. The morph stage is a
* standard stage that scales each forcefield parameter by
* (1-:lambda:).initial + :lambda:.final
*/
void LambdaSchedule::addMorphStage(const QString &name)
{
this->addStage(name, (this->lam() * this->final()) +
((1 - this->lam()) * this->initial()));
}

/** Append a morph stage onto this schedule. The morph stage is a
* standard stage that scales each forcefield parameter by
* (1-:lambda:).initial + :lambda:.final
*/
void LambdaSchedule::addMorphStage()
{
this->addStage("morph", (this->lam() * this->final()) +
((1 - this->lam()) * this->initial()));
this->addMorphStage("morph");
}

/** Sandwich the current set of stages with a charge-descaling and
Expand All @@ -450,7 +459,9 @@ void LambdaSchedule::addMorphStage()
* by :gamma:. A final charge-rescaling stage is then appended that
* scales the charge parameter from :gamma:.final to final.
*/
void LambdaSchedule::addChargeScaleStages(double scale)
void LambdaSchedule::addChargeScaleStages(const QString &decharge_name,
const QString &recharge_name,
double scale)
{
auto scl = this->setConstant("γ", scale);

Expand All @@ -462,11 +473,24 @@ void LambdaSchedule::addChargeScaleStages(double scale)
}

// now prepend the decharging stage, and append the recharging stage
this->prependStage("decharge", this->initial());
this->appendStage("recharge", this->final());
this->prependStage(decharge_name, this->initial());
this->appendStage(recharge_name, this->final());

this->setEquation(decharge_name, "charge", (1.0 - ((1.0 - scl) * this->lam())) * this->initial());
this->setEquation(recharge_name, "charge", (1.0 - ((1.0 - scl) * (1.0 - this->lam()))) * this->final());
}

this->setEquation("decharge", "charge", (1.0 - ((1.0 - scl) * this->lam())) * this->initial());
this->setEquation("recharge", "charge", (1.0 - ((1.0 - scl) * (1.0 - this->lam()))) * this->final());
/** Sandwich the current set of stages with a charge-descaling and
* a charge-scaling stage. This prepends a charge-descaling stage
* that scales the charge parameter down from `initial` to
* :gamma:.initial (where :gamma:=`scale`). The charge parameter in all of
* the exising stages in this schedule are then multiplied
* by :gamma:. A final charge-rescaling stage is then appended that
* scales the charge parameter from :gamma:.final to final.
*/
void LambdaSchedule::addChargeScaleStages(double scale)
{
this->addChargeScaleStages("decharge", "recharge", scale);
}

/** Prepend a stage called 'name' which uses the passed 'equation'
Expand Down
5 changes: 5 additions & 0 deletions corelib/src/libs/SireCAS/lambdaschedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ namespace SireCAS
const SireCAS::Expression &equation);

void addMorphStage();
void addMorphStage(const QString &name);

void addChargeScaleStages(double scale = 0.2);
void addChargeScaleStages(const QString &decharge_name,
const QString &recharge_name,
double scale = 0.2);

void setEquation(const QString &stage,
const QString &lever,
Expand Down
46 changes: 30 additions & 16 deletions corelib/src/libs/SireIO/moleculeparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2323,17 +2323,24 @@ QStringList MoleculeParser::write(const System &system, const QString &filename,
QStringList filenames;
QStringList fileformats;

const auto format_property = map["fileformat"];

if (format_property.hasValue())
if (map.specified("fileformat"))
{
try
const auto format_property = map["fileformat"];

if (format_property.hasSource())
{
fileformats = format_property.value().asA<StringProperty>().toString().split(",");
fileformats = format_property.source().split(",");
}
catch (...)
else
{
fileformats.append(format_property.value().asA<MoleculeParser>().formatName());
try
{
fileformats = format_property.value().asA<StringProperty>().toString().split(",");
}
catch (...)
{
fileformats.append(format_property.value().asA<MoleculeParser>().formatName());
}
}

const auto fileinfo = QFileInfo(filename);
Expand All @@ -2353,7 +2360,7 @@ QStringList MoleculeParser::write(const System &system, const QString &filename,
// we need to find the format from the system
try
{
fileformats = system.property(format_property).asA<StringProperty>().toString().split(",");
fileformats = system.property(map["fileformat"]).asA<StringProperty>().toString().split(",");
}
catch (...)
{
Expand Down Expand Up @@ -2404,17 +2411,24 @@ QStringList MoleculeParser::write(const System &system, const QStringList &files
QStringList filenames;
QStringList fileformats;

const auto format_property = map["fileformat"];

if (format_property.hasValue())
if (map.specified("fileformat"))
{
try
const auto format_property = map["fileformat"];

if (format_property.hasSource())
{
fileformats = format_property.value().asA<StringProperty>().toString().split(",");
fileformats = format_property.source().split(",");
}
catch (...)
else
{
fileformats.append(format_property.value().asA<MoleculeParser>().formatName());
try
{
fileformats = format_property.value().asA<StringProperty>().toString().split(",");
}
catch (...)
{
fileformats.append(format_property.value().asA<MoleculeParser>().formatName());
}
}

if (files.count() != fileformats.count())
Expand Down Expand Up @@ -2449,7 +2463,7 @@ QStringList MoleculeParser::write(const System &system, const QStringList &files
// we may need to find the format from the system
try
{
fileformats = system.property(format_property).asA<StringProperty>().toString().split(",");
fileformats = system.property(map["fileformat"]).asA<StringProperty>().toString().split(",");
}
catch (...)
{
Expand Down
Loading