IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
HybridMonteCarlo.h
Go to the documentation of this file.
1/**
2 * \file IMP/isd/HybridMonteCarlo.h
3 * \brief A hybrid monte carlo implementation
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 *
7 */
8
9#ifndef IMPISD_HYBRID_MONTE_CARLO_H
10#define IMPISD_HYBRID_MONTE_CARLO_H
11
12#include <IMP/isd/isd_config.h>
13#include <IMP/core/MonteCarlo.h>
16#include <IMP/macros.h>
17
18IMPISD_BEGIN_NAMESPACE
19
20//! Hybrid Monte Carlo optimizer
21// moves all xyz particles having a fixed mass with an MD proposal
22
23class IMPISDEXPORT HybridMonteCarlo : public core::MonteCarlo {
24
25 public:
26 HybridMonteCarlo(Model *m, Float kT = 1.0, unsigned steps = 100,
27 Float timestep = 1.0, unsigned persistence = 1);
28
29 Float get_kinetic_energy() const;
30
31 Float get_potential_energy() const;
32
33 Float get_total_energy() const;
34
35 // set md timestep
36 void set_timestep(Float ts);
37 double get_timestep() const;
38
39 // set number of md steps per mc step
40 void set_number_of_md_steps(unsigned nsteps);
41 unsigned get_number_of_md_steps() const;
42
43 // set how many mc steps happen until you redraw the momenta
44 void set_persistence(unsigned persistence = 1);
45 unsigned get_persistence() const;
46
47 // return pointer to isd::MolecularDynamics instance
48 // useful if you want to set other stuff that is not exposed here
49 MolecularDynamics *get_md() const;
50
51 // evaluate should return the total energy
52 double do_evaluate(const ParticleIndexes &, bool) const override;
53
54 virtual void do_step() override;
55 IMP_OBJECT_METHODS(HybridMonteCarlo);
56
57 private:
58 unsigned num_md_steps_, persistence_;
59 unsigned persistence_counter_;
62};
63
64IMPISD_END_NAMESPACE
65
66#endif /* IMPISD_HYBRID_MONTE_CARLO_H */
A modifier which perturbs XYZs or Nuisances with a constant energy MD simulation.
Simple Monte Carlo optimizer.
A Monte Carlo optimizer.
Definition MonteCarlo.h:46
double do_evaluate(const ParticleIndexes &, bool) const override
Get the current energy.
virtual void do_step() override
a class that inherits from this should override this method
Molecular dynamics optimizer on 1-D and 3-D particles.
Simple molecular dynamics optimizer.
Various general useful macros for IMP.
double Float
Basic floating-point value (could be float, double...).
Definition types.h:19
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144
A smart pointer to a reference counted object.
Definition Pointer.h:88