Kappa-Dev / KappaTools

Tool suite for kappa models. Documentation and binaries can be found in the release section. Try it online at
http://kappalanguage.org/
GNU Lesser General Public License v3.0
112 stars 41 forks source link

KaJaSim feature idea: suggest diving by symmetry number observables #217

Open hmedina opened 8 years ago

hmedina commented 8 years ago

When an observable has two symmetries, KaSim reports twice what's there. If I define with initial condition one single lone symmetric dimer, KaSim reports in the output there are two dimers, even if the snapshot shows only one dimer (documented in chapter 8 of the manual).

Merritt of maintaining symmetry agnosticism aside, KaJaSim would benefit from issuing a notification to the user when dealing with symmetries, in rules as in observables.

pirbo commented 8 years ago

In the language of algebraic variable, | pattern | does not means "how many often pattern appears in the mixture?" but "How many embeddings of patternthere is in the mixture?" Of course, the user cares about the first one but KaSim efficiently computes only the second one. The question (I discussed with @jkrivine months ago and I should ask @vd1 and @russharmer) is "How to compute statically the formula that correspond to the first question in term of requests of the second kind?"

When dealing with patterns with 1 connected component, it is indeed just a matter of deciding by the number of automorphisms but, for example, the number of A(y), A(x!1),B(x!1) in the mixture is | A(y) | * | A(x!1), B(x!1) | - |A(x!1,y), B(x!1) |. What now when there are more connected components or both several connected components and symmetries ...

feret commented 8 years ago

Dear Pierre,

When you count instances of patterns, you discard clashes as well, don't you ?

If so, I do not understand why counting instances is easier than counting number of embeddings.

Anyway, I would bet 3 cents for a formula of this kind:

Consider a pattern P (P is a concrete pattern). Consider the set of the foldings of P (agents in a folding are now identified by a set of agent identifiers). Define the polarity of a folding as 0 if the number of fold operations (one fold operation consists in merging two agents, and propagating by rigidity) is even, and as -1 otherwise.

Then decompose each such folding in connected components.

Bet:

number of embeddings of P in the mixture M =

\sum_{for each folding P'=C'1,...,C'{k_p'}} (-1)^polarity * \prod number of embeddings of C'_i in the mixture M

The coefficient (-1)^polarity may sound surprising, but it comes from the formal expansion of (1 + (-1))^n . Ferdinanda is using a similar formula in ODE fragmentation (and this is proved correct in her context). The bet is that the problem is similar, but some care has to be made to check how each folding is counted.

Cheers. Jerome.


Jerome Feret DI - Ecole Normale Superieure 45, rue d'Ulm 75230 Paris Cedex 5

phone: +33 1 44 32 37 66 fax : +33 1 44 32 21 51 mail : feret@ens.fr

On Sun, 1 May 2016, Pierre Boutillier wrote:

In the language of algebraic variable, | pattern | does not means "how many often pattern appears in the mixture?" but "How many embeddings of patternthere is in the mixture?" Of course, the user cares about the first one but KaSim efficiently computes only the second one. The question (I discussed with @jkrivine months ago and I should ask @vd1 and @russharmer) is "How to compute statically the formula that correspond to the first question in term of requests of the second kind?"

When dealing with patterns with 1 connected component, it is indeed just a matter of deciding by the number of automorphisms but, for example, the number of A(y), A(x!1),B(x!1) in the mixture is | A(y) | * | A(x!1), B(x!1) | - |A(x!1,y), B(x!1) |. What now when there are more connected components or both several connected components and symmetries ...

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub[AARtszeJyMXi03JNn2MxqyHGsTQ6mxxNks5p9W7igaJpZM4IE9_v.gif]

russharmer commented 8 years ago

hi Pierre,

Do you want to resolve all clashes statically? My recollection of how simplx/KaSim3 works is that: each connected component has its matchings stored independently and clashes are detected dynamically. This works even in cases like your example here: the 'correction' term [ - |A(x!1,y), B(x!1) | ] is those cases where you've chosen twice the same A. If you want to detect and resolve this statically, you will need to do

The issue of preserved automorphisms is completely orthogonal to this. All you need to do there is to compute that number and divide the given rate constant by it; IMHO, there is no point messing around trying to quotient the space of matchings -- the end result will be exactly the same for a lot more work done.

Cheers, russ

On Mon, May 2, 2016 at 5:26 AM, Pierre Boutillier notifications@github.com wrote:

In the language of algebraic variable, | pattern | does not means "how many often pattern appears in the mixture?" but "How many embeddings of patternthere is in the mixture?" Of course, the user cares about the first one but KaSim efficiently computes only the second one. The question (I discussed with @jkrivine https://github.com/jkrivine months ago and I should ask @vd1 https://github.com/vd1 and @russharmer https://github.com/russharmer) is "How to compute statically the formula that correspond to the first question in term of requests of the second kind?"

When dealing with patterns with 1 connected component, it is indeed just a matter of deciding by the number of automorphisms but, for example, the number of A(y), A(x!1),B(x!1) in the mixture is | A(y) | * | A(x!1), B(x!1) | - |A(x!1,y), B(x!1) |. What now when there are more connected components or both several connected components and symmetries ...

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Kappa-Dev/KaSim/issues/217#issuecomment-216099160

Russ Harmer http://perso.ens-lyon.fr/russell.harmer/ CNRS & ENS Lyon