API reference#
Model and analyses#
- class symident.Model(odes=None, observables=None, *, reactions=None, totals=None, trafo=None, conditions=None, events=None, inputs=(), unknown_inputs=(), known_inputs=(), fixed=(), parameters=(), regimes=None, equilibrate=None, positive=None, reduce_cq=None)[source]#
An ODE model with observables, conditions and events.
- Parameters:
- odesdict, optional
Right-hand sides, state name to expression (
^or**for powers), with switches such aspiecewise()and comparisons allowed (see the guide). Derived fromreactionswhen omitted.- observablesdict or list of dict
Observables, name to expression; a list gives one dict per condition.
- reactionsdict, optional
Reaction network with keys
species,stoichiometry(reactions by species) andrates; it gives thetotalsand the zero-state analysis underequilibrate.- totalsdict, optional
Conserved totals, name to expression, each conserved by the right-hand sides; computed from
reactions, else from the linear conservation laws ofodes, when omitted, as nonnegative combinations where these span the laws.reduce_cqeliminates one species per total.- trafodict or list of dict, optional
Parameter transformation; an entry named like a state sets the initial value of that state. A list holds one transformation per condition.
- conditionspandas.DataFrame or dict, optional
One row per condition; a numeric cell fixes a symbol, a string replaces it by an expression or another name, and a column named like a state sets the initial value of that state. As a dict:
{"rows": [...], "cols": {name: [values]}}.- eventslist of dict, optional
Events with keys
var,time,valueandmethod(replace,addormultiply);rootin place oftimeresetsvareach time the root expression changes sign, andcondlists the conditions (from 0) an event belongs to, all by default. Each condition starts at \(t = 0\), or at the earliest event of the condition when that comes before; an event at the start applies to the initial values.- inputssequence of str
Input states, zero at the start and at rest; an event sets them.
- unknown_inputssequence of str
Unknown functions of time of no assumed form, symbols in the right-hand sides and observables without an equation. A direction may change them along with the parameters (see the guide).
- known_inputssequence of str
Known functions of time of no assumed form, symbols in the right-hand sides and observables without an equation; their values and time derivatives are known.
- fixedsequence of str
Known symbols.
- parameterssequence of str
Additional symbols treated as parameters.
- regimeslist or dict, optional
The regimes an experiment visits, for a model with switches: each entry is a comparison or a list of comparisons that selects the regimes on those sides, the first entry the regime at the start; a dict gives one list per condition name. Without it every regime counts. See the guide.
- equilibratebool, optional
The default of
detect()’sequilibratefor this model.- positivebool or sequence of str, optional
The default of
detect()’spositivefor this model.- reduce_cqbool, optional
The default of
detect()’sreduce_cqfor this model.
- classmethod from_petab(path)[source]#
The model of a PEtab problem; see
read_petab().
- symident.read_petab(path)[source]#
A
Modelfrom a PEtab problem.- Parameters:
- pathstr
The YAML file of a PEtab problem, format version 1 or 2, with one SBML model.
- Returns:
- Model
One condition per experiment (v1: per pair of preequilibration and simulation condition) with measurements. The estimated parameters stay symbols; every other parameter takes the nominal or SBML value.
Model.equilibrateis set when every experiment starts with a preequilibration or is a readout at rest, andModel.reduce_cqwhen the preequilibrated network has conserved totals.Model.positiveholds the estimated parameters of the model on a log scale or with a positive lower bound.m.petablists the experiments, the estimated parameters, the fixed values, the renamed ids, underwithout_effectthe estimated parameters that no remaining term holds and underat_restthe experiments read at rest.
- Raises:
- PEtabError
For an SBML or PEtab feature without a counterpart in the model language: algebraic rules, delays, fast reactions, variable stoichiometry, a volume that depends on species, event triggers other than a time or one comparison, and preequilibration in some experiments only; and for a problem the reader cannot map, such as several subproblems, a fixed parameter without nominal value or an unknown condition target.
- Warns:
- UserWarning
For estimated parameters without effect on the model: every term that holds them vanishes in every experiment.
Notes
An id that the expression language cannot read, one with a leading underscore or one that names a constant such as
pi, gets anXin front or an_behind, in the model and in every table;m.petab["renamed"]maps the ids of the problem to the new names. The time of an SBML event takes the values of the event parameters in each experiment.A volume that a rate rule changes is a state, one that an assignment rule in time and parameters gives enters with the time derivative of the volume, and a concentration in either is diluted by \(-[x] V'/V\). A volume that an event or a period resets keeps the amount of every species in it that the reset does not set. The noise model does not enter, nor does a log transformation of an observable. A placeholder of an observable takes the override from the measurement table; one observable measured with several overrides in an experiment becomes one observable per override. A parameter that a later period changes becomes the value at the start plus an input, zero at rest, that an event at the start of the period sets; where every period sets the value the parameter already has, there is no input. A species target of a period after the first is an event. A switch between two expressions at a time that every experiment fixes becomes a step state, off during a preequilibration, that an event switches on at that time or at the start.
An experiment in one period without a preequilibration whose measurements are all at time
infis a readout at rest: the system starts from the values of the condition, rests under that condition, and only the resting values of the observables enter. The reading assumes that a resting state exists and is the one the experiment reaches. An experiment with a finite measurement time is a trajectory; so is every experiment when one of them starts without a preequilibration and is not a readout at rest, with a warning, since all conditions start alike.A parameter value that names another parameter, such as an initial assignment, takes the value of that parameter in each experiment. States that start at 0 in every experiment, that no event sets and whose rates vanish where all of them are 0 leave the model.
- exception symident.PEtabError[source]#
A PEtab problem or SBML model that the reader does not support.
- symident.detect(model, *, scalings_only=False, equilibrate=None, reduce_cq=None, free_initial=None, reconstruct=False, positive=None, verify=True, gauge=False, cores=1, control=None, engine='modular', trace=False, mode='local', global_options=None)[source]#
Structural non-identifiabilities of a model, locally and, with
mode="global", globally.- Parameters:
- modelModel
- scalings_onlybool
Only the scaling symmetries, from an exact integer kernel.
- equilibratebool, optional
Start at a steady state with the inputs at zero, then apply the events at the start; a state without dynamics that is not an input rests at the initial value. Defaults to
model.equilibrate, elseFalse.- reduce_cqbool, optional
Eliminate one species per conserved total and take the totals as coordinates; an event on a species of a total changes the total. Defaults to
model.reduce_cq, elseFalse.- free_initialsequence of str, optional
States that hold the free resting value of their total (
equilibratewithoutreduce_cq), one per total with independent coefficients; an invalid choice raises anInputError. Not given, the states are chosen by the structure of the model, choices that tie are compared by rank status and levels, andinfo["settings"]["free_initial"]holds the states taken.- reconstructbool
Return general directions as exact rational functions.
- positivebool or sequence of str, optional
Coordinates known to be positive; defaults to
model.positive, elseTrue. An entry may be an expression positive on the domain, such as"1-x"for a fractionxbelow one.- verifybool
Check the rank where the Lie order is not proven sufficient.
- gaugebool, None or sequence of str
Falsereconstructs every direction;Nonefixes one coordinate per scaling, chosen to keep the general directions narrow; a sequence ranks the coordinates to fix (*as wildcard).- coresint
Threads and worker processes.
- controldict, optional
Settings from
reconst_control().- enginestr
"modular"(finite fields) or"symbolic"(sympy, small models).- tracebool or str
Print stage timings;
"full"adds the Lie-order diagnostics.- modestr
"local"analyzes local identifiability only."global"analyzes it first, reduces the directions found, and then counts the values of the coordinates with the output of a generic one and reconstructs the maps between them, the discrete symmetries (Symmetries.discrete(), needs msolve, impliesreconstruct=True). The result holds them indiscrete_symmetriesandinfo["discrete"]; a model the global analysis does not handle gets the reason ininfo["discrete"]["unsupported"]and a warning.- global_optionsdict, optional
Arguments of the global analysis:
order,points,memory,experimentsand the work limitsmsolve_entries,msolve_terms,search_entriesandelimination_termsofSymmetries.discrete().
- Returns:
- Symmetries
- symident.reduce(result, *, fixed=None, positive=None, d_poly=3, d_darboux=2, d_exp=2, separable=True, zero_limits=False, alternatives=False, allow_open=True, allow_checked=True, check=True, work_cap=4000, branch=None)[source]#
Reparametrization that removes the directions of a detection result.
The model is described in the invariants of the directions, each a new parameter
q_<k>. The invariants are coordinates on the quotient of the parameter space by the orbits, a chart, which is returned only where it is valid on the declared domain. A scaling (Symmetry.kind) fixes one coordinate to one, a translation is replaced by the linear invariants with a coordinate fixed to zero on a face of the positive orthant, and a curved direction by the invariants of that direction.- Parameters:
- resultSymmetries or dict
A detection result, or the raw form from
to_dict().- fixedsequence of str, optional
Coordinates with known values; defaults to the gauge of the result.
- positivebool or sequence of str, optional
Coordinates known to be positive; defaults to the setting of the detection.
- d_poly, d_darboux, d_expint
Degree bounds of polynomial and rational invariants, Darboux polynomials and exponential-factor numerators.
- separablebool
Solve separable blocks by quadratures.
- zero_limitsbool
Report which coordinates each block can drive to zero.
- work_capint
Candidate sections the search of one block may try; reaching it is an entry in
Reduction.limits.- alternativesbool
Also return, in
Reduction.alternatives, the charts of the other valid choices of the fixed coordinates; they are searched anyway when the first chart contains a root that does not simplify.- allow_openbool
Reduce the directions with a closed form and leave those of level
"open"in place, with a warning;Falsemakes such a direction an error.- allow_checkedbool
Reduce also on a direction of level
"checked"and on a result whose saturation check failed, with a warning;Falsemakes either an error.- checkbool
Run the detection again on the model with the trafo applied (closed loop) and record in
Reduction.checkswhether exactly the remaining directions are left; needs the model of aSymmetriesresult of a detection withoutscalings_only. Large models may turn it off.- branchstr, optional
With a discrete symmetry of a detection with
mode="global": the side of the fixed set as an inequality, such as"k01 > k12", on which the trafo maps free values in the positive orthant one to one, chained with the section;Reduction.discrete["branches"]lists the sides. Without it every branch is inReduction.alternativesand the trafo is the section alone.
- Returns:
- Reduction
- Warns:
- UserWarning
When a direction is open, checked or verified, the saturation check failed, or a claim of a section is not proven.
Results#
- class symident.Symmetries(raw, model=None)[source]#
Result of
detect().- Attributes:
- identifiablebool or None
Whether the model is structurally locally identifiable;
Nonewithscalings_only.Trueis proven.Falseholds as far asinfo["rank_status"]says: with a lower bound the model may still be identifiable.- rank, dimint or None
Rank of the OIM and number of coordinates;
Nonewithscalings_only.- symmetrieslist of Symmetry
The non-identifiable directions; a direction is the generator \(X = \sum_i \xi_i \, \partial_{\theta_i}\).
- infodict
The computation:
rank_status:status("proven","verified"or"lower bound"),whyandprobability; with a lower bound the number of directions is an upper bound.rank_provenandrank_proof: the number of directions that prove the rank, and how;rank_fieldsandrank_fields_bound: the directions held by invariant fields at every order, and the error bound of their check.coordinates: the coordinates of the analysis, parameters and free initial values.lie_order_used,lie_block_orders,lie_order_driver,lie_plateau: the Lie order taken, per condition or chain, the condition that needs the highest, and the flat orders that ended the saturation.lie_certified,lie_uncertified: whether the order is proven sufficient, and the conditions where it is not;lie_certificate: why the symbolic engine has no certificate.gap_order_used,gap_certified,gap_certificate,gap_bound: the same for the gap order of events after the start;series_certified,series_certificate: for the series order of resting states (Nonewhere they do not apply).order_bound,order_bound_why: the probability that a certified order is not sufficient, or why there is none;order_draws: the most points drawn for one random point of the Lie order certificate, which multiplies the terms of the certificate.bound: the probability that a wrong closed form passes the kernel check, or why none applies.proof: per direction verified on every entry, why the exact proof did not apply;attempts: per open direction, the routes tried and why they failed.verification: the saturation guard, withokandreason; whereokis False the rank still grows past the order used.projection: the rank modulo the unknown inputs, modulo the fresh coordinates of switch surfaces, or modulo resting states whose Jacobian is singular at the base point.unknown_inputs,known_inputs: per input the jets and the order up to which they are exact.assumptions: the declareddomainand switchstartsthe result assumes, and theerror_boundof a verified closed form or rank.limits: the work caps and orders that stopped part of the analysis; while it is not empty, a direction without closed form may have one.errors: exceptions a route recorded.branches: resting states with several roots modulo a prime, and the one taken.switching: the surfaces and regimes of a model with switches; where the rule of the switches is not proven,uncertifiedsays why andcandidateslists the directions it leaves open, which are not reported as symmetries.zero_states: states every condition keeps at zero, which the analysis drops.gauge_suggestion: the coordinates a gauge would fix, in a detection without gauge that has scalings and general directions.conditions,segments,engine,elapsed,timing,settings: the number of conditions and of segments between events, the engine, the seconds elapsed in total and per stage, and the settings of the detection.
- gaugelist of str or None
The coordinates fixed by a gauged detection.
- modelModel or None
A copy of the model detected.
- methodstr
"observability", or"scaling"withscalings_only.
- unproven()[source]#
The directions of level
"verified"or"checked", whose closed form is checked but not proven.- Returns:
- list of Symmetry
- summary(verbose=False)[source]#
The computation report and the result.
- Parameters:
- verbosebool
Also the settings
verify,sym_engineanddegree_cap, and the reason of each direction without closed form.
- Returns:
- str
- solution_count(order=None)[source]#
The number of values of the coordinates that give the output of a generic one.
Local identifiability leaves finitely many such values; more than one is a discrete symmetry, which the Lie method does not see. The count solves the Taylor coefficients of the observables up to order at a random point modulo a prime with msolve, so it is a check at that point, not a proof. Values are counted over the algebraic closure, so values outside the declared domain, such as the negative root of a square, count too. The model has one condition (a one-row grid or one-element lists), no events, switches or unknown inputs.
- Parameters:
- orderint, optional
The highest Taylor coefficient; twice the number of coordinates by default.
- Returns:
- dict or None
{"count", "order", "prime"}, or None where the model is not rational, msolve fails, reaches the work caps (msolve_entriesandmsolve_termsofdiscrete()), or the solutions are not finitely many. Points where a coordinate or a denominator vanishes are not counted.
- Raises:
- ValueError
For a result detected with
reduce_cq, a model with unknown inputs, or a model that is not rational after the rewrites.- MsolveMissingError
Where msolve is not found (
install_msolve()).
- discrete(order=None, points=5, cores=1, memory=None, experiments=None, msolve_entries=None, msolve_terms=None, search_entries=None, elimination_terms=None)[source]#
The discrete symmetries: other values of the coordinates in the domain with the same output.
The Taylor coefficients of the observables up to order are equated with their values at a point. msolve counts the solutions over the algebraic closure modulo a prime, and over the reals in the declared domain at points random rational points, where the number may differ between regions. Where the other solutions are rational functions sigma of the coordinates, sigma is reconstructed from the characteristic polynomials of the coordinates over the solutions, checked on the output at random points (
"checked") and, where every state has a free initial value, proven by the map of the states ("exact"). Permutations of coordinates with the same dependence of the output are tested as candidates first. A model with logarithmic coordinates, observables under an injective function or factorsexp(a*time)is rewritten into rational form with the same fiber, and the results are given in the coordinates of the model. Other non-rational terms of the states become new states and new coordinates, their values at the start; the count is then that of this relaxed model (info["relaxed"]). A free power x^alpha of a state that starts at 0 enters through (x/c)^alpha, c the leading Taylor coefficient of x, as a series in t and t^(k*alpha) (info["start_powers"]). A sigma that maps no point of the domain into it is listed but not relevant. The jets of unknown inputs are unknowns of the count, not coordinates; a sigma may change the input (state_maps). A result ofreduce_cqis counted on the level sets of the conserved totals, with the species solved through the totals ininfo["eliminated"].- Parameters:
- orderint, optional
The highest Taylor coefficient; twice the number of coordinates by default.
- pointsint or list of dict
The number of random points of the count in the domain, or the points themselves as
{coordinate: value}.- coresint
Threads of msolve.
- memoryfloat, optional
GiB of address space one call of msolve may take, 8 by default; past it the call fails.
- experimentsbool or int, optional
The count of several experiments with shared parameters and free starts, projected onto the parameters and starts of the first, which bounds the fiber of a model with free starts and no rational first integral, proven at one point of the parameters (docs/method/global.rst, “Several experiments”). By default it runs where a short count of one experiment finds none;
Trueruns it first with the number of experiments from the rank criterion, a numberKwithKexperiments,Falsenever.info["experiments"]reports it, or why it does not apply.- msolve_entriesint, optional
The nonzero entries of the matrices of the F4 rounds that one call of msolve may reduce, 4 * 10^8 by default, read from the output of msolve; the call ends after the round that passes it, without a result. The first short count and the count of a block before the stages take a fraction of it.
- msolve_termsint, optional
The most terms of one system given to msolve, 10^5 by default; a larger system is not solved.
- search_entriesint, optional
The entries of the matrices over finite fields that the exact count may reduce, 5 * 10^8 by default, in the search for the invariant functions as rational functions of the output coefficients (docs/method/global.rst, “The exact count”).
- elimination_termsint, optional
The most terms of a polynomial of the elimination of the states in the exact count, 3 * 10^6 by default.
- The global analysis stops on these work limits and on further fixed caps on orders,
- points and candidates, never on a clock, so that the result is the same on every machine.
- A count or a proof that reaches a limit ends without a result, and ``info[“limits”]`` or
- the certificate names the limit and the value of the limit.
- Returns:
- dict
symmetries: per sigma themapof the coordinates it changes,changes,level,found_by("candidates","fiber"),state_maps(the maps of the states that prove it, one per segment),preserves_domain(True, False, or None with thedomain_conditionsunder which sigma(theta) lies in the domain) andfixed_set, the factors on which sigma fixes theta.info:order,count(solutions over the algebraic closure at a random point modulo a prime),count_bound(the probability that a generic point has more, None where the count is exact or has no bound),count_domain(the points of the fiber of a generic point of the domain inside the domain, where the count is final and each map keeps the domain or leaves it entirely, else None),countsper point (complex,real,in_domain,undecided),closed_forms,count_final(every solution is the image of a proven sigma),fundamental_domain(inequalities that keep one point of each orbit),rewrites,candidates,timing(seconds per stage),certificate(what the result rests on: the invariance per map, the size of the orbit,exactwith the invariant functions as rational functions of the output coefficients, the verified count withcount_bound, or the axiom of the count where neither applies, andcomplete:"exact","verified","axiom","no"or"open"; with the count of several experiments alsoroute, andpinnedwhere the exact search stopped and the functions it proved were counted),experiments(the number of experiments, the orders, the count and the certificatefirst_integralsof the premise, orwhythe route does not apply) andlimits.
- Raises:
- ValueError
Unless the result is identifiable and was detected without
equilibrate, on a model with one condition and no events or switches, and for a model with unknown inputs and events, switches or more than one condition.- MsolveMissingError
Where msolve is not found (
install_msolve()).
- class symident.Symmetry[source]#
One non-identifiable direction, a dict whose entries are also attributes.
- Attributes:
- typestr
"scaling"or"general": found as an integer scaling, or otherwise.- kindstr or None
The orbit geometry:
"scaling"(\(\xi_i = w_i \theta_i\), orbits are lines in logarithmic coordinates, monomial invariants),"translation"(constant \(\xi\), orbits are lines in linear coordinates, linear invariants, a section on a face of the positive orthant) or"curved"(all others), each up to a common factor of the components;Nonewithout a closed form. Translations and curved directions are of type"general".- supportlist of str
Coordinates the direction moves.
- explicitbool
Whether the generator is known in closed form.
- generatordict or None
Component \(\xi_i\) per coordinate as a string;
Nonewhen not reconstructed.- weightsdict or None
Integer weights \(w_i\) of a scaling as strings, \(\xi_i = w_i \theta_i\).
- degreeint or None
Total degree of the components.
- levelstr
How far the direction is established:
"exact": proven over Q."verified": in the kernel at random points modulo a verification prime \(q\), with the error probability ininfo["bound"]; at a start at rest (equilibrate) on the resting variety of the parameters drawn."checked": the same test without an error bound, or on part of the entries only;info["bound"]says why a bound does not apply."open": no closed form;reasonsays why.
- state_componentsdict or None
For an exact direction, the components \(\xi_x\) on the states of the field that proves it, \(X = \sum \xi_\theta \partial_\theta + \sum \xi_x \partial_x\), in the first condition;
Nonewhere none is needed or known.- input_changedict or None
For an exact direction of a model with
unknown_inputs, the component \(\xi_w\) of the proving field on each unknown input;Noneotherwise.- routestr or None
How a closed form was obtained, e.g.
"static subsystem".- reasonstr or None
Why a direction has no closed form.
- complete_generator, factordict or None, str or None
The generator times
factor, a positive function that makes the flow exist for all times;Nonefor very long components.- displaydict
Factored components of a general direction, where shorter.
- class symident.Reduction(raw)[source]#
Result of
reduce(): the model in a chart, the invariants of the directions as new parameters.- Attributes:
- trafodict or None
Parameter transformation over all coordinates;
Nonewithout directions. An entry named in a condition grid goes into the cells of the grid; underequilibratean entry named like a state pins the resting value it holds, which a model takes infixedwhen it is a number.- blockslist of dict
One entry per set of coupled directions, with
labels,support,status("reduced","fixed"whenfixedremoves the scaling,"invariant_only"when no section is certified,"unresolved"),stage(the invariant search that reduced it),level,generator_level,unproven(the claims of the block section not proven),pinsand, withzero_limits,zero_compatibility. A scaling block holds the pinned coordinates astransversal. A general block holdsinvariantsandnew_parameters(the invariant eachq_<k>stands for); a curved one alsosection,solved_domain,count,injective(every orbit meets the section at most once; not claimed under partial coverage or on a face) andreach(every level set of the invariants is one orbit).coverageis"partial"when the section covers part of the positive orthant only;sign_conditionsthen lists the entries without a positivity certificate as conditions on the new parameters, and the trafo covers the orbits on which they hold. A face section (face) holdsface_why, why the model is not shown continuous up to the face (Nonewhen it is), andface_level. A block of directions that unknown inputs absorb holdsinputs: the inputs (absorb), theproof("inversion"with thedeterminant, or"lift"with the components of the lift per direction) and theconditionunder which the section gives the output of a point.- removed, remaininglist of str
Labels of the directions.
- dependentlist of str
Labels of listed directions that depend on the others and need no reduction.
- alternativeslist of dict
The charts of the other valid choices of the fixed coordinates, each with
trafo,pins,removed,remainingandrational; the returned one has the best level, removes the most directions, and prefers charts withoutsign_conditions, then charts that cover the whole domain, then a rational trafo.- partiallist of str
Removed directions whose chart covers only part of the domain: some positive coordinates have no positive preimage in the new parameters.
- levelstr
The lowest level of the reduced blocks:
"exact","verified","checked"or"open", the last when a claim of a section is not proven.- assumptionsdict
What the reduction assumes:
domain(the declared positive coordinates,Truefor all) andstarts(the sides of switches declared at the start byregimes, per condition), together witherror_bound, the probability that a verified closed form or rank of the detection is wrong (Nonewithout one).- checksdict
pinsandinvariants: whether every pin holds under the trafo and every invariant of a block maps to the new parameter of the invariant, over Q (failedlists the others), andwhywhere SymPy failed;loop: the closed loop ofreduce(check=True), with the number of directions the reduced model has, the number expected, therank_statusof that detection,ok(Nonewhere the loop could not run) andreason.- errorslist of str
Exceptions that the reduction turned into failed routes, such as an alternative section left out (see the
DEBUGswitch).- limitslist of str
The work caps that stopped a section or invariant search.
- coordinateslist of str
The coordinates of the detection.
- fixedlist of str
The coordinates held fixed: the
fixedargument ofreduce(), else the gauge of the detection.- discretedict or None
With a detection that searched discrete symmetries (
detect(mode="global")): thesymmetriesthat can map a point of the domain into it, thefundamental_domain, inequalities that keep one point of each of their orbits, and thecoordinatesthey are stated in (the reduced model’s for a model with directions).injectiveandreachof a section refer to the orbits of the directions: a discrete symmetry maps a point of the section to another point with the same output, which the fundamental domain excludes.branchesholds per side of the fixed set of the map the chart of that side (seereduce(),branch),branchthe chosen one, andwhythe reason where there are none.
Settings and programs#
- symident.reconst_control(relevance_cap=6, relevance_cap_dir=24, relevance_cap_sparse=30, degree_cap=4, sample_slack=5, probe_retries=8, laurent_deg_num=4, laurent_deg_den=2, laurent_cand_cap=200000, term_cap=60, general_deg_num=4, general_deg_den=3, gap_order_cap=8, minsupport_cand_cap=20000, perprime_cap=120, perprime_min_primes=3, homotopy=True, homotopy_degree=4, seed=0, exact_proof=True, degree_cap_max=8, exact_work_cap=500000, input_jet_order=0)[source]#
Saturation and closed-form reconstruction settings.
- Parameters:
- relevance_capint
Coordinates in one entry for the dense fit; wider entries use sparse interpolation.
- relevance_cap_dirint
Coordinates in one direction; a wider one is reported by the support. The narrow route, which samples the kernel on the support of the direction alone, bounds each entry only where the model has no event gaps, resting states or unknown inputs.
- relevance_cap_sparseint
Coordinates in one entry for the sparse fit; a wider entry is reported by the support of the direction.
- degree_capint
Total degree bound of the dense rational fit.
- degree_cap_maxint
Total degree up to which an entry past degree_cap is probed along lines, doubling the bound, and fitted at the degree found.
- sample_slackint
Samples beyond the minimum of the fit.
- probe_retriesint
Retries of the relevance probe when a perturbation changes the pivots.
- laurent_deg_num, laurent_deg_denint
Numerator degree and monomial denominator degree of the sparse Laurent fit.
- laurent_cand_capint
Candidate monomials of the Laurent and general sparse fits.
- term_capint
Terms of a sparse entry.
- general_deg_num, general_deg_denint
Numerator and denominator degree of the general sparse rational fit.
- gap_order_capint
Highest order of the power series in the time between events; reaching it is an entry in
info["limits"]. Curve samples of resting conditions start at this order and double it, up to four times, where a kernel at eps = 1 needs more.- minsupport_cand_capint
Column subsets searched for directions with small support.
- perprime_capint
Samples per prime for the reconstruction under a steady state.
- perprime_min_primesint
Primes with samples for a reconstruction under a steady state.
- homotopybool
Whether directions still open are fitted along parameter lines as a last route.
- homotopy_degreeint
Total degree bound of the entries fitted by the homotopy route.
- seedint
Seed of the random choices: sample points and the order of trials. The same seed and model give the same result.
- exact_proofbool
Whether closed forms that no route proved over Q are proven through the fields of each regime; this runs a detection per regime unless the field route already did.
- exact_work_capfloat
Work budget of those detections, regimes times coordinates times tape length; past it the proof is skipped and listed in info[“limits”].
- input_jet_orderint
Jets per unknown input, the input and the time derivatives of the input; 0 chooses them from the model and lengthens them while the Lie order reaches past them.
- Returns:
- dict
- symident.switches(**kw)[source]#
Set switches for the duration of a
withblock.- Parameters:
- **kw
Switch names, listed in the API reference, with their values. A value wins over the environment variable
SYMIDENT_<NAME>:TrueandFalseswitch a flag on and off, and a number sets a number switch.Noneremoves the setting, so that the environment variable decides again. A path switch (MSOLVE,CACHE) takes a path.
Examples
>>> import symident as si >>> with si.switches(DEBUG=True, TIMING=True): ... si.detect(model)
- symident.install_msolve(dir=None, version=None, jobs=None, quiet=False, ask=None)[source]#
Build msolve from source into a per-user cache.
msolve solves the coupled resting-state systems of
detect(..., equilibrate=True)and the systems ofsolution_count(). It is built with static GMP, MPFR and FLINT; the build needs a C compiler,make,m4andcurlorwget, network access and a few minutes. Not available on Windows. With the defaultdirsymident finds the build without further settings; for anotherdirsetSYMIDENT_CACHEto it.- Parameters:
- dirstr, optional
Cache directory; defaults to
cache_dir().- versionstr, optional
msolve release; defaults to
SYMIDENT_MSOLVE_VERSION, else the tested release.- jobsint, optional
Parallel
makejobs; defaults toSYMIDENT_JOBS, else the available cores, at most 8.- quietbool
Suppress the build output.
- askbool, optional
Ask before downloading; defaults to whether the session is interactive.
- Returns:
- str or None
Path of the msolve executable, None if the user declined.
- Raises:
- RuntimeError
On Windows, without
curl/wget,makeorm4, or when the build fails.
- symident.install.find_msolve()[source]#
The msolve to use and where it was found, (path, source), or (None, None).
Searched in order: SYMIDENT_MSOLVE, the builds in the cache, each
deps-msolve-<version>/bin/msolve(msolve.exeon Windows) with an empty filedeps-msolve-<version>/.msolve-complete, then msolve on the PATH if it is a tested version. Each candidate must solve a test system.- Returns:
- tuple
(path, source)with source"SYMIDENT_MSOLVE","cache"or"PATH", or(None, None).
Switches#
Each switch is an environment variable SYMIDENT_<NAME> or a keyword of
switches().
Debugging:
DEBUGexceptions a route would record in
info["errors"]are raised, except failures of SymPy.DIAGevery diagnostic switch on.
KERNEL_MODEforwardorreversefixes the mode of the kernel rows,checkbuilds every call in both and raises where the rows differ; environment only.
Diagnostic output:
TIMINGstage times.
LIEDIAGsaturation, Lie order caps and sufficiency proofs.
ROUTEDIAGerrors inside the narrow and forward routes.
FWDDIAGthe forward seed of the resting states.
SOLVEDIAGeach resting-state solve.
HOMDIAGthe homotopy route.
BANKDIAGthe sample bank of the dense fit.
STATICDIAGthe static subsystem fields.
REDDIAGthe reduction solve.
JOINTDIAGthe joint resting-state rows.
CURVEDIAGthe lines and kernels at eps = 1 of curve samples.
Routes:
NOFIELDSno invariant-field routes (global symmetries, field proof).
NOJETno jet route inside the narrow route.
NOGROUPno translation groups in the narrow route.
NOFWDSEEDno forward seed of the resting states.
NODIAGno diagonal start: resting conditions continued from the forward one only.
RESTCURVEcurve samples of the resting conditions also where a direct solve is cheap.
NORESTCURVEdirect resting solves for reconstruction and checks, never curve samples.
NOSHAREDa tape per condition also where the conditions differ only in the values of symbols.
NOSELECTevery condition analyzed, also where many conditions add nothing to the rank.
Numbers:
LIEPLATEAUorders the rank stays flat before the saturation ends (3).
LIEPLATEAU_BLOCKthe plateau per condition block; 0 for one plateau.
STACKEDPLATEAUin the first pass over the stacked rows of many conditions, the plateau as a fraction of the order the rank last rose at, consecutive orders without change (0.5); it decides no claim: that pass settles a rank only by proven directions or invariant fields.
VERIFY_MARGINorders the saturation guard checks past the reported one (6).
JETWORKcharacters of jets the jet route may form (1000000).
BLOCKMBmegabytes of Taylor values per column block of the kernel (an eighth of the physical memory over the cores, 256 to 1024); environment only.
JETMBmegabytes of the jets the kernel keeps for calls at higher orders (eight column blocks); environment only.
MSOLVE_GBgigabytes of address space of one call of msolve in discrete() where
memoryis not given (8).FIBER_TERMSterms of the equations of the fiber that one count of discrete() takes (400000).
Installation of msolve:
MSOLVEpath of the msolve executable.
CACHEdirectory of the symident cache.
MSOLVE_VERSIONmsolve version install_msolve() builds.
GMP_VERSIONGMP version install_msolve() builds.
MPFR_VERSIONMPFR version install_msolve() builds.
FLINT_VERSIONFLINT version install_msolve() builds.
JOBSparallel jobs of install_msolve().