home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.6.1
The Integrative Modeling Platform
IMP Manual
Reference Guide
Modules
Classes
Examples
version 2.6.1
core/pair_restraint.py
Restrain the distance between a pair of particles.
1
## \example core/pair_restraint.py
2
# Restrain the distance between a pair of particles.
3
#
4
5
import
IMP.example
6
import
sys
7
8
IMP.setup_from_argv
(sys.argv,
"pair restraint"
)
9
10
(m, c) = IMP.example.create_model_and_particles()
11
12
uf =
IMP.core.Harmonic
(0, 1)
13
df =
IMP.core.DistancePairScore
(uf)
14
inds = c.get_indexes()
15
r =
IMP.core.PairRestraint
(m, df, (inds[0], inds[1]))
16
print(r.evaluate(
False
))