🔎 Full API reference¶
The exhaustive, auto-generated reference: every public module in bertini, produced by
walking the package at build time. Nothing here is hand-maintained, so it always matches the
code – when the namespace changes, this follows.
For the everyday API – the common types and functions you reach for constantly – see the curated pages; this page is the complete index for when you need to find something specific.
bertini – Python bindings for Bertini 2¶
This code is licensed under the GNU Public License, Version 3, with additional clauses under section 7 as permitted, to protect the Bertini name. See b2/licenses/ for a complete copy of the license, and the licenses of software upon which Bertini depends.
See the source at https://github.com/bertiniteam/b2
- bertini.solve(system, seed=None, directory=None, precision='adaptive', endgame='cauchy', homotopy=None, start=None)[source]
Solve a polynomial system, recording and resuming automatically.
Ensure-answered semantics: the solve consults the ambient records directory first; paths already recorded for this exact ask (system + settings + seed) are taken from the records, and only the rest are computed. Rerun a crashed script and it finishes; rerun a finished one and it is instant.
- Parameters:
system (System) – The target system (no path variable).
seed (int, optional) – The reproducibility seed.
solve(sys, seed=42)means the same homotopy – the same gamma, start points, and patch – forever, on every machine. Omitted: an EFFECTIVE seed is derived for this solve and the solve runs under it, so the seed recorded in the run’s ask reproduces that run standalone – a mid-session solve does not silently depend on the session’s earlier draw history. (Consecutive seedless solves get distinct seeds, chained deterministically fromset_random_seed’s master when one was set.)directory (str, optional) – Records directory override; default is ambient (see
records_dir).homotopy (System, optional) – A homotopy you built (e.g.
bertini.nag_algorithm.blend_homotopy()), for a CHAINED solve: its paths run from yourstartpoints at t=1 tosystem’s solutions at t=0. Requiresstart.start (SolveResult or iterable of points, optional) – Where the paths start. A prior
SolveResult(or its solutions) chains with full provenance – the records link every new endpoint back through the prior run, all the way to the beginning. Raw points (arrays) are archived as a given: provenance bottoms out honestly at data you supplied.precision (str) – Passed through to
bertini.nag_algorithm.ZeroDimSolver()(mptype/endgame).endgame (str) – Passed through to
bertini.nag_algorithm.ZeroDimSolver()(mptype/endgame).
- Returns:
The finite solutions (as
Solutionpoints that remember their run) plus the run id – a claim ticket, safe to drop.- Return type:
- bertini.save(*args, description='', directory=None)[source]
Save almost anything under a name:
save(thing)orsave(name, thing).A
SolveResult(or anything with.run_idand.solutions) is declared as results with full provenance; any JSON-able value (dict, list, number, string) is recorded inline. The declaration lands inhistory/(the points themselves live inresults/, referred to by {run, index}). A namelesssave(thing)is auto-named by timestamp; re-saving a name replaces it (newest wins).
- bertini.load(name=None, directory=None)[source]
Load saved results by name – the other half of
save().load("my favorites")returns that result (its points, annotations, provenance, or its inline value);load()returns the whole dict of everything saved, by name. Reads the plain records – declarations and annotations fromhistory/, the referenced points fromresults/– so this works in any later session, on any producer’s directory, and the same files are readable without bertini at all.
- bertini.annotate(point, key, value, directory=None)[source]
Attach metadata to a solution:
annotate(sol, 'projection', 1.5).pointis aSolution(or anything with.provenanceholding{'run', 'index'}), or an explicit{'run': ..., 'index': ...}dict. The annotation lands in the records beside the point it describes (readers such asload()merge it in); re-annotating the same key replaces it (newest wins).valueis any JSON-able thing.
- bertini.solutions_of(run, directory=None, status='success')[source]
The recorded endpoints of a run, as
Solutionpoints with provenance.Works on ANY run in the directory – including runs written by the command-line
bertini2or on another machine: this reads the plain records, no solver object needed. The points are in USER coordinates, exact to the recorded precision, and carry{'run', 'index'}provenance, so they chain directly:solve(B, homotopy=H, start=solutions_of(run_id)).statusfilters by recorded verdict ('success'default; passNonefor every tracked path – audits want all three populations).
- bertini.provenance(point, directory=None)[source]
Walk a point’s provenance back to the beginning: the chain of
{'run','index'}hops, ending at a canonical start label or a given (user-supplied data).pointis aSolution(or anything with.provenance), or an explicit{'run': ..., 'index': ...}dict. Reads the plain records – runs written by the CLI and by Python walk the same.
- bertini.recording(on=None)[source]
The one-line on/off switch for the records:
bertini.recording(False).Recording is ON BY DEFAULT for every solver in the process –
solve,ZeroDimSolver,HomotopySolver– into the ambient directory (seerecords_dir). With recording off, solves run bare: no directory is written or consulted (so no resuming either), and the ambientBERTINI_RECORDS_DIRattach is suppressed for this process.recording(True)turns it back on. Call with no argument to ask the current state.For the command line, the same switch is the environment:
BERTINI_RECORDS_DIR=nonerunsbertini2without records (the empty string also works on POSIX; Windows deletes empty-valued variables, sononeis the portable spelling).
- bertini.records_dir(path=None)[source]
Get (or set, by passing a path) the ambient records directory for this process.
Resolution when unset: the
BERTINI_RECORDS_DIRenvironment variable, else./bertini_output. Created on demand. Returns the resolved path as a string.Ambient recording is ON BY DEFAULT for every solver in the process –
ZeroDimSolverandHomotopySolverrecord here just likesolve, with no code at all. Setting a path chooses WHERE: it is exported toBERTINI_RECORDS_DIR, which the solver classes read for their ambient attach.recording(False)is the off switch: while recording is off, nothing is exported and the off sentinel survives.
- bertini.runs(directory=None)[source]
One row per recorded run, as a
pandas.DataFrame.Columns:
run,when,op,num_paths,seed,tracker,endgame,target_digest,recalls(how many later sessions answered this ask from the store – 0 means computed once, never re-asked),producer_version,producer_commit. Reads the plain records – any directory, any producer (CLI or Python).
- bertini.tracks(run=None, directory=None, coordinates=False)[source]
One row per tracked path (newest record per (run, index)), as a DataFrame.
Columns:
run,index,status,outcome(the endgame verdict’s name),start_kind,start_run,start_index,cycle_num,path_time_seconds. Passrun=to restrict to one run.coordinates=False(the default) keeps endpoints OUT of the table – they are most of the bytes, and a million-path audit usually wants the statuses, not the numbers.coordinates=Trueadds anendpoint_usercolumn of complex tuples.
- bertini.provenance_graph(directory=None, runs=None)[source]
The provenance of every recorded point, as a
networkx.DiGraph.Nodes are points
('run_id', index)plus origins('start_label', i)/('given', definition_id, i); each edge points FROM where a path started TO its endpoint (time flows along edges). Node attributes:run,index,status; edge attributerun(the run that tracked it).Pass
runs=(an iterable of run ids) to restrict a large directory to the chains you care about – a million-path directory makes a million-node graph, which networkx holds but no drawing survives (seeplot_chain(), which aggregates instead).
- bertini.plot_chain(directory=None, runs=None, ax=None, max_paths_drawn=200)[source]
Draw the chain left to right: each run is a column, paths flow rightward from their starts to their endpoints.
Small chains draw every path (green = success, orange = diverged, red = failed; origins are squares). A run with more than
max_paths_drawnpaths is NOT drawn path-by-path – the whole figure falls back to one node per run with edge widths showing how many paths flow between runs, so a million-path chain renders in milliseconds instead of crashing your session.Returns the matplotlib Axes.
- class bertini.Solution(coordinates, provenance=None, annotations=None)[source]
Bases:
ndarrayA solution point: coordinates that remember where they came from.
Behaves exactly like the numpy array you expect (index it, print it, feed it to a solver), while carrying
.provenance({'run': ..., 'index': ...}– the recorded path that produced it) and.annotationsinvisibly. Arithmetic produces plain derived points: a computed combination is a new thing, and its provenance is honestly absent.
- class bertini.SolveResult(solutions, run_id, directory, num_recalled, solver)[source]
Bases:
objectWhat
solvereturns: the solutions plus a claim ticket on the recorded run.Forgetting to capture it loses nothing – the records hold the truth; another
solveof the same ask re-mints an equivalent result (recalled, not recomputed).- __init__(solutions, run_id, directory, num_recalled, solver)[source]
- solutions
the finite solutions, user coordinates
- Type:
list[Solution]
- run_id
the recorded run’s id ({run, index} is a point reference)
- Type:
str
- directory
the records directory this run lives in
- Type:
str
- num_recalled
paths taken from the records instead of computed
- Type:
int
- property solver
The underlying solver object (all_solutions, solution_metadata, …).
- class bertini.Variable((object)arg1, (str)arg2) object
Bases:
AbstractNamedSymbol- __init__((object)arg1, (str)arg2) object
- bertini.variables(base, indices, fmt='{base}{index}')[source]
Make a list of integer-indexed Variables.
base -- name prefix, e.g. 'x' indices -- an int n (shorthand for range(n)) or any iterable of ints fmt -- str.format template using {base} and {index}; default '{base}{index}' gives x0, x1, x2, ...
Returns a
list[Variable]. Wrap in a VariableGroup if desired:pb.VariableGroup(pb.variables('x', 5))
- bertini.gather_variables((bertini._pybertini.container.ListOfNode)functions) bertini._pybertini.container.VariableGroup :
Return the distinct variables appearing in a list of functions, ordered alphabetically by name.
- gather_variables( (AbstractNode)node) -> bertini._pybertini.container.VariableGroup :
Return the distinct variables appearing in an expression, ordered alphabetically by name.
- class bertini.VariableGroup((object)arg1)
Bases:
instance__init__( (object)arg1, (object)arg2) -> object
- __init__( (object)arg1, (str)arg2, (int)arg3) -> object :
VariableGroup(name, count): the variables name0, name1, …, name{count-1}
- __init__((object)arg1) None
__init__( (object)arg1, (object)arg2) -> object
- __init__( (object)arg1, (str)arg2, (int)arg3) -> object :
VariableGroup(name, count): the variables name0, name1, …, name{count-1}
- append((VariableGroup)arg1, (object)arg2) None
- extend((VariableGroup)arg1, (object)arg2) None
- bertini.Named
alias of
NamedExpression
- class bertini.System((object)arg1)
Bases:
instanceThe type in Bertini for systems of simultaneous equations. Add functions and variable groups via member functions.
- __init__( (object)arg1, (bertini._pybertini.container.ListOfNode)functions) -> None :
Construct a System from a list of functions (bare expressions). The variables are auto-discovered from the functions and placed into a single affine variable group, ordered alphabetically by name.
- __init__((object)arg1) None
- __init__( (object)arg1, (bertini._pybertini.container.ListOfNode)functions) -> None :
Construct a System from a list of functions (bare expressions). The variables are auto-discovered from the functions and placed into a single affine variable group, ordered alphabetically by name.
- add(*objects)
Add functions and/or variable groups to the System, dispatched by type.
- Each argument may be:
a function-tree expression (e.g.
x**2 + y - 1, or a loneVariable) -> added as a function;a
VariableGroup-> added as an affine variable group;a numpy array / list / tuple of the above -> each element is added (so
sys.add(A @ x - lam*x),sys.add([f, g]), andsys.add(grp, f, g)work).
Projective groups still use
add_hom_variable_group(); structured blocks useadd_linear(). Returnsselffor chaining.
- add_function((System)self, (bertini._pybertini.function_tree.AbstractNode)f) None :
Add a function (a bare expression) to the System
- add_functions(expressions)
Add a vector/array of expressions as individual functions; returns the count added.
expressionsmay be a numpy object array, a (possibly nested) list, or a single expression node:sys.add_functions(A @ x - lam * x)
- add_hom_variable_group((System)self, (bertini._pybertini.container.VariableGroup)group) None :
Add a projective or homogeneous variable group to the System
- add_linear(A, x, b=None)
Add the linear conditions
A @ x + b == 0as one LinearFormsBlock.Ais an exact (m x n) coefficient matrix;xa length-n vector of the system’s variables (each already in a variable group);ban optional length-m exact constant vector (default zero). Coefficients must be exact. Returns self. Homogenization-aware.
- add_linear_forms(coefficients)
Add an affine-linear-forms block f(x) = M [x;1] (one LinearFormsBlock).
coefficientsis an (m x num_vars+1) array/list of EXACT values – one row per function, the trailing column being each form’s constant term. Python floats are refused. Returns self.
- add_linear_forms_block((System)self, (int)num_vars, (numpy.ndarray)coefficients) None :
Add a block of affine linear forms f(x) = M [x;1] to the System, evaluated as a single matrix-vector product rather than as scalar expressions. coefficients is an complex_mp matrix with one row per function and num_vars+1 columns; the trailing column carries each form’s constant term.
- add_path_variable((System)self, (bertini._pybertini.function_tree.symbol.Variable)pathvar) None :
Add a path variable to the System
- add_products_of_linears(factors)
Add a products-of-linear-forms block: f_i(x) = prod_r ( c_{i,r} . [x;1] ).
factorsis a list with one entry per function; entry i is an exact (k_i x num_vars+1) matrix (one row per linear factor, trailing column the factor’s constant). A product of k factors is one function of degree k. Coefficients must be exact. Returns self.
- add_products_of_linears_block((System)self, (int)num_vars, (list)factors) None :
Add a block of products-of-linear-forms f_i(x) = prod_r ( c_{i,r} . [x;1] ) to the System, evaluated as matrix-multiplies-then-row-products rather than as scalar expressions. factors is a list with one entry per function; entry i is an complex_mp matrix with one row per linear factor and num_vars+1 columns (the trailing column carries each factor’s constant term). Each function’s degree is its number of factors.
- add_slices_as_products(slices)
Add one products-of-linears function per slice (the regeneration bridge).
Each
Slicebecomes a single function that is the product of its linear forms. Slice coefficient columns must follow the system’s variable ordering. Returns self.
- add_variable_group((System)self, (bertini._pybertini.container.VariableGroup)group) None :
Add a (affine) variable group to the System
- auto_patch((System)self) None :
Apply a patch to the system, given its current variable group structure.
- clear_variables((System)self) None :
Remove the variable structure from the system
- content_digest((System)self) str :
The persistent content digest of the system: SHA-256 of its canonical exact encoding, as 64 lowercase hex characters. Stable across sessions, machines, and versions of the encoding format (a format change bumps the version inside the encoding, changing digests loudly rather than silently). Everything evaluation-relevant is identity – functions, variable groups and ordering, path variable, patch and randomization coefficients, gamma; randomness included. Transient state (precision, current variable values, differentiation) is not. This is the key a database of solutions references systems and homotopies by.
- copy_patches((System)self, (System)other) None :
Copy the patches from another system into this one.
- copy_variable_structure((System)self, (System)other) None :
Copy the variable structure from another System
- degrees((System)self) bertini._pybertini.container.ListOfInt :
Get a list of the degrees of the functions in the system, with respect to all variables in all groups (and in fact overall)
- degrees( (System)self, (bertini._pybertini.container.VariableGroup)group) -> bertini._pybertini.container.ListOfInt :
Get a list of the degrees of the functions in the system, with respect to a variable_group passed in to this function. Negative numbers indicate non-polynomial
- dehomogenize_point((System)self, (numpy.ndarray)point) numpy.ndarray :
Dehomogenize a vector of doubles (complex), using the variable structure in this System
- dehomogenize_point( (System)self, (numpy.ndarray)point) -> numpy.ndarray :
Dehomogenize a vector of mpfr’s (complex), using the variable structure in this System
- describe((System)self[, (bool)verbose=False]) str :
A human-facing description of the system, block by block (the same as str(system) when verbose=False). verbose=True reveals the actual coefficients/matrices and the underlying functions of randomization / blend blocks. For reading, not re-parsing.
- differentiate((System)self) None :
differentiate the system with respect to the declared variable groups
- eval((System)self) numpy.ndarray :
Evaluate the system in multiple precision, using already-set variable values.
- eval( (System)self) -> numpy.ndarray :
Evaluate the system in double precision, using already-set variable values.
- eval( (System)arg1, (numpy.ndarray)self) -> numpy.ndarray :
Evaluate the system in multiple precision, using space variable values passed into this function.
- eval( (System)arg1, (numpy.ndarray)self) -> numpy.ndarray :
Evaluate the system in double precision, using space variable values passed into this function.
- eval( (System)arg1, (numpy.ndarray)arg2, (bertini._pybertini.multiprec.complex_mp)self) -> numpy.ndarray :
Evaluate the system in multiple precision using space and time values passed into this function. Throws if doesn’t use a time variable
- eval( (System)arg1, (numpy.ndarray)arg2, (complex)self) -> numpy.ndarray :
Evaluate the system in double precision using space and time values passed into this function. Throws if doesn’t use a time variable
- eval_jacobian((System)self) numpy.ndarray :
Evaluate the Jacobian (martix of partial derivatives) of the system, using already-set time and space value.
- eval_jacobian( (System)self) -> numpy.ndarray :
Evaluate the Jacobian (martix of partial derivatives) of the system, using already-set time and space value.
- eval_jacobian( (System)arg1, (numpy.ndarray)self) -> numpy.ndarray :
Evaluate the Jacobian (martix of partial derivatives) of the system, using space values you pass in to this function
- eval_jacobian( (System)arg1, (numpy.ndarray)self) -> numpy.ndarray :
Evaluate the Jacobian (martix of partial derivatives) of the system, using space values you pass in to this function
- eval_jacobian( (System)arg1, (numpy.ndarray)arg2, (complex)self) -> numpy.ndarray :
Evaluate the Jacobian (martix of partial derivatives) of the system, using time and space values passed into this function. Throws if doesn’t use a time variable
- eval_jacobian( (System)arg1, (numpy.ndarray)arg2, (bertini._pybertini.multiprec.complex_mp)self) -> numpy.ndarray :
Evaluate the Jacobian (martix of partial derivatives) of the system, using time and space values passed into this function. Throws if doesn’t use a time variable
- eval_time_derivative((System)self, (numpy.ndarray)space, (bertini._pybertini.multiprec.complex_mp)time) numpy.ndarray :
Evaluate dH/dt (the time derivative) in multiple precision at the given space and time values. Rows of t-independent blocks are zero.
- eval_time_derivative( (System)self, (numpy.ndarray)space, (complex)time) -> numpy.ndarray :
Evaluate dH/dt (the time derivative) in double precision at the given space and time values. Rows of t-independent blocks are zero.
- function((System)self, (int)index) bertini._pybertini.function_tree.AbstractNode :
Get a function with a given index. Problems ensue if out of range – uses un-rangechecked version of underlying getter
- get_patch((System)self) object :
Get (a reference to) the patches from the system.
- have_path_variable((System)self) bool :
Asks whether the System has a path variable defined
- hom_variable_groups((System)self) bertini._pybertini.container.ListOfVariableGroup :
Get the list of projective / homogeneous variable_groups from the system
- homogenize((System)self) None :
Homogenize the system, adding new homogenizing variables if necessary. This may change your polynomials; that is, it has side effects.
- homogenize_point((System)self, (numpy.ndarray)point) numpy.ndarray :
Take a point in user (dehomogenized) coordinates to this system’s internal coordinates: inserts the homogenizing coordinate for each affine variable group, then rescales onto the system’s patch if patched. Inverse of dehomogenize_point.
- homogenize_point( (System)self, (numpy.ndarray)point) -> numpy.ndarray :
Take a point in user (dehomogenized) coordinates to this system’s internal coordinates: inserts the homogenizing coordinate for each affine variable group, then rescales onto the system’s patch if patched. Inverse of dehomogenize_point.
- is_homogeneous((System)self) bool :
Determines whether all polynomials in the system have the same degree. Non-polynomial functions are not homogeneous.
- is_patched((System)self) bool :
Check whether the system is patched.
- is_polynomial((System)self) bool :
Determines whether all polynomials are polynomial. Transcendental functions, e.g., are non-polynomial. Returns a bool.
- is_same((System)self, (System)other) bool :
Content equality: True iff the two systems have equal content digests (identical canonical encodings). Independently built systems with the same mathematical content compare equal; systems differing in any identity-bearing way (functions, grouping, patch, gamma, …) do not. Does NOT change ==/hash semantics of the Python object.
- is_sealed((System)self) bool :
Whether the system has been sealed against structural mutation.
- jacobian(usercoordinates=True)
The symbolic Jacobian of the system, as a 2-D numpy object array of expression nodes.
J[i, j]is the partial derivative of functioniwith respect to variablej– an expression tree, not a number (contrasteval_jacobian(), which is numeric). Ready tonumpy.vstackonto a coefficient row and@a vector of variables.- Parameters:
usercoordinates (bool, default True) – When True, differentiate the functions as authored (the natural, pre-homogenization functions) with respect to the user-declared affine/projective variable groups: the solver-added homogenizing variables never appear and patches are omitted. When False, differentiate the functions as currently stored (possibly homogenized) with respect to the full internal variable ordering (homogenizing variables included), with the patch’s rows appended when the system is patched.
Notes
For a system that has already been homogenized, the user-coordinate Jacobian relies on the natural functions snapshotted at homogenization time. Build the system affinely and call
jacobianbefore homogenizing/solving for the cleanest result.
- num_functions((System)self) int :
The total number of functions in the system. Does not include patches.
- num_hom_variable_groups((System)self) int :
The number of homogeneous or projective variable groups. The number of homogenizing variables should eventually equal this.
- num_hom_variables((System)self) int :
The number of homogenizing variables defined in the system. Should be equal to the number of homvargroups
- num_ungrouped_variables((System)self) int :
The number of variables, not grouped into an affine or projective space
- num_variable_groups((System)self) int :
The number of affine variable groups. This should probably be renamed to num_affine_variable_groups
- num_variables((System)self) int :
the total number of variables in the system. Includes homogenizing variables
- precision((System)self) int :
Get the current precision of the system. Returns a postive number, representing the number of digits (not bits) at which the system is currently represented. (there is a reference-level precision stored, so you can change this up / down mostly fearlessly)
- precision( (System)self, (int)precision) -> None :
Set / change the precision of the system. Feed in a positive number, representing the digits (not bits) of the precision. Double precision is 16, but that only effects the multi-precision precision… you can eval in double precision without changing the precision to 16.
- randomization_matrix((System)self) numpy.ndarray :
The randomization matrix R (n x N, complex_mp) of a system produced by randomize(). Raises if the system has no randomization block.
- randomize(matrix=None)
Randomize an overdetermined System down to a square one, returning a NEW system.
matrixis an optional exact coefficient matrix R (one row per randomized function, one column per natural function); whenNonebertini builds a generic R. The original is not mutated. Coefficients must be exact.
- reorder_functions_by_degree_decreasing((System)self) None :
Change the order of the functions to be in decreasing order
- reorder_functions_by_degree_increasing((System)self) None :
Change the order of the functions to be in decreasing order
- rescale_point_to_fit_patch((System)self, (numpy.ndarray)point) numpy.ndarray :
Return a rescaled version of the input point, which fits the patch for the system.
- rescale_point_to_fit_patch( (System)self, (numpy.ndarray)point) -> numpy.ndarray :
Return a rescaled version of the input point, which fits the patch for the system.
- rescale_point_to_fit_patch_in_place((System)self, (numpy.ndarray)point) None :
Re-scale the input point, in place, to fit the patch for the system. This assumes you have properly set the variable groups and auto-patched the system.
- rescale_point_to_fit_patch_in_place( (System)self, (numpy.ndarray)point) -> None :
Re-scale the input point, in place, to fit the patch for the system. This assumes you have properly set the variable groups and auto-patched the system.
- seal((System)self) None :
Seal the system: memoize its content digest and forbid structural mutation (hashcons-on-freeze). After sealing, structural mutators (add_function, homogenize, auto_patch, …) raise; evaluation, precision changes, and differentiation still work. Copying (clone / deepcopy) yields an unsealed copy. Idempotent.
- set_path_variable((System)self, (complex)values) None :
Set the value of the path variable. This one’s double-precision. Throws if path variable not defined.
- set_path_variable( (System)self, (bertini._pybertini.multiprec.complex_mp)values) -> None :
Set the value of the path variable. This one’s variable-precision. Throws if path variable not defined.
- set_variable_groups((System)self, (bertini._pybertini.container.ListOfVariableGroup)groups) None :
Replace the entire variable-group structure of the System with the given list of (affine) variable groups. Clears existing groups but preserves the path variable.
- set_variables((System)self, (numpy.ndarray)values) None :
Set the values of the variables. Expects a vector of doubles
- set_variables( (System)self, (numpy.ndarray)values) -> None :
Set the values of the variables. Expects a vector of complex mpfr’s
- slices((System)self) list :
The linear-form slices embedded in this system, one per linear-forms block (an empty list if none). Lets you back out the slice structure of a system that was built from a slice – the inverse of Slice.as_system().
- symbolic_jacobian((System)self[, (bool)usercoordinates=True]) list :
The symbolic Jacobian of the system, as a list of rows of expression nodes (NOT numeric – contrast eval_jacobian). usercoordinates=True (default): differentiate the natural (pre-homogenization) functions w.r.t. the user-declared affine/projective variable groups – homogenizing variables never appear, patches omitted. usercoordinates=False: differentiate the current (possibly homogenized) functions w.r.t. the full internal variable ordering (homogenizing variables included), with the patch’s rows appended when patched. Prefer bertini.System.jacobian(…), which returns a 2-D numpy object array.
- to_classic_input((System)self[, (int)mptype=2[, (int)odepredictor=5[, (float)tracktolbeforeeg=1e-05[, (float)tracktolduringeg=1e-06[, (float)finaltol=1e-11[, (float)maxstepsize=0.1[, (float)stepsuccessfactor=2.0[, (float)stepfailfactor=0.5[, (int)stepsforincrease=5[, (int)maxnumbersteps=100000[, (int)maxnewtonits=2[, (int)maxcrossedpathresolves=2]]]]]]]]]]]]) str :
Emit this system as a Bertini 1 classic input file (a CONFIG + INPUT string) so the same problem can be solved in Bertini 1 for cross-validation. Every tracking knob that governs path resolution – predictor, tolerances, and the FULL step-size cadence (maxstepsize / stepsuccessfactor / stepfailfactor / stepsforincrease) plus maxnewtonits – is settable, so the emitted file is fully controlled against a Bertini 2 solve (defaults mirror Bertini 2’s). mptype: 0 double, 1 fixed-multiple, 2 adaptive. odepredictor: 0 Euler, 2 RK4, 5 RKF45, 6 Cash-Karp. AMP coeff/degree bounds are derived from the system. Run bertini1 on the result in a SCRATCH dir (it writes many files into its CWD).
- variable_groups((System)self) bertini._pybertini.container.ListOfVariableGroup :
Get the list of (affine) variable_groups from the system
- variable_ordering((System)self) bertini._pybertini.container.VariableGroup :
The ordering of variables saying what each coordinate of a point in THIS system’s coordinates means. On your original system these are your variables; on a solver’s target_system() the homogenizing variables appear too.
- bertini.jacobian(functions, variables)[source]
The symbolic Jacobian of
functionswith respect tovariables.J[i, j]is the partial derivative offunctions[i]with respect tovariables[j], returned as a 2-D numpy object array of function-tree nodes – always 2-D, even for a single function, so it is ready tonumpy.vstackonto a coefficient row and@a vector of variables. This is purely symbolic (it builds expression trees via differentiation); it does not evaluate. For a wholeSystemusebertini.System.jacobian(), which is homogenization-aware.- Parameters:
functions (node or iterable of nodes) – A single expression node or a sequence of them (a list or numpy object array).
variables (iterable of Variable) – The variables to differentiate with respect to (a list, a numpy object array such as
bertini.variables(), or aVariableGroup).
Examples
>>> import bertini as pb >>> x, y, z = pb.Variable('x'), pb.Variable('y'), pb.Variable('z') >>> J = pb.jacobian([x*y, x - z], [x, y, z]) >>> J.shape (2, 3)
- bertini.random_matrix(rows, cols, real=False, units=False, orthonormal=True, symbolic=False)[source]
A
rowsxcolsrandom matrix, at the current default precision.The building block for a random linear form / projection / slice / patch – they are all just linear functions, and “what you use them for is up to you.” Returns a numpy array of arbitrary-precision values (
bertini.multiprec.Complex); passsymbolic=Trueto instead get coefficient nodes ready to drop straight into function-tree expressions.- Parameters:
rows (int) – The shape of the matrix.
cols (int) – The shape of the matrix.
real (bool, default False) – When True the entries are real (zero imaginary part); otherwise complex.
units (bool, default False) – When True (and not
orthonormal) each entry has modulus 1 (arealunit is +/-1); otherwise each entry is drawn with bounded modulus (box-uniform in [-1,1] per component).orthonormal (bool, default True) – When True the rows are conjugate-orthonormal (QR-factored from a square matrix of units, then truncated – perfectly conditioned).
real=Truegives a real orthogonal matrix.orthonormaltakes precedence overunits(orthonormal rows are already normalized).symbolic (bool, default False) – When True, return a numpy object array of coefficient nodes (via
bertini.coefficients()); otherwise numericmultiprec.complex_mp.
Notes
Reproducible via
bertini.random.set_random_seed(). A projection is just a linear functional with zero constant term, so its gradient row is exactlyrandom_matrix(1, n).
- bertini.coefficient(value)[source]
Coerce a single exact value into a function-tree coefficient node.
Accepts bertini nodes (returned unchanged),
int/ numpy integers,fractions.Fraction, exact strings ('2.5'or'3/4'), and bertini multiprecision values. RaisesTypeErrorfor Pythonfloat/complex(and numpy floating types) – a floating-point literal would cap precision.There are four ways to spell an exact non-integer coefficient:
>>> from fractions import Fraction >>> import bertini >>> from bertini import multiprec >>> _ = bertini.coefficient('2.5') # exact decimal string >>> _ = bertini.coefficient('3/4') # exact rational string >>> _ = bertini.coefficient(Fraction(3, 4)) # a fractions.Fraction >>> _ = bertini.coefficient(multiprec.complex_mp('0.1')) # a full-precision multiprec value
A Python
floatis refused:bertini.coefficient(0.1)raisesTypeError. An exact complex coefficient is amultiprec.complex_mpwith real and imaginary parts:bertini.coefficient(multiprec.complex_mp('0.6', '0.8')).
- bertini.coefficients(array_like)[source]
Coerce an array (or nested list) of exact values to an object array of coefficient nodes.
Use this to bring a non-integer matrix or vector into the function tree:
A = bertini.coefficients([['5/2', '1'], ['0', '3']]) # exact rationals A = bertini.coefficients(fraction_matrix) # fractions.Fraction entries
Integer arrays do not need this: numpy
int * Variablealready buildsIntegercoefficients. Refuses Python floats (seecoefficient()).
- class bertini.complex_mp((object)arg1)
Bases:
generic,instance- __init__( (object)self, (float)real) -> None :
Construct variable-precision complex number from a double, with 0 imaginary part. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (real_mp)real) -> None :
Construct variable-precision complex number from a variable-precision float, with 0 imaginary part
- __init__( (object)self, (str)real) -> None :
Construct variable-precision complex number from a string, with 0 imaginary part
- __init__( (object)self, (real_mp)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a pair of variable-precision floats
- __init__( (object)self, (float)real, (float)imag) -> None :
Construct variable-precision complex number from a pair of doubles. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (str)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a string and a variable-precision float
- __init__( (object)self, (real_mp)real, (str)imag) -> None :
Construct variable-precision complex number from a variable-precision float and a string
- __init__( (object)self, (str)real, (str)imag) -> None :
Construct variable-precision complex number from a pair of strings. the best way to construct one and be sure you have padded with zeros to the end, in the current working precision
- __init__( (object)self, (complex_mp)value) -> None :
Construct variable-precision complex number from another one
- __init__( (object)self, (int_mp)real) -> None :
Construct variable-precision complex number from an arbitrary-precision integer, with 0 imaginary part
- __init__( (object)self, (int_mp)real, (int_mp)imag) -> None :
Construct variable-precision complex number from a pair of arbitrary-precision integers
- __init__((object)arg1) None
- __init__( (object)self, (float)real) -> None :
Construct variable-precision complex number from a double, with 0 imaginary part. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (real_mp)real) -> None :
Construct variable-precision complex number from a variable-precision float, with 0 imaginary part
- __init__( (object)self, (str)real) -> None :
Construct variable-precision complex number from a string, with 0 imaginary part
- __init__( (object)self, (real_mp)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a pair of variable-precision floats
- __init__( (object)self, (float)real, (float)imag) -> None :
Construct variable-precision complex number from a pair of doubles. do this with caution, as 0.1 is not what you think it is – there’s noise at the end.
- __init__( (object)self, (str)real, (real_mp)imag) -> None :
Construct variable-precision complex number from a string and a variable-precision float
- __init__( (object)self, (real_mp)real, (str)imag) -> None :
Construct variable-precision complex number from a variable-precision float and a string
- __init__( (object)self, (str)real, (str)imag) -> None :
Construct variable-precision complex number from a pair of strings. the best way to construct one and be sure you have padded with zeros to the end, in the current working precision
- __init__( (object)self, (complex_mp)value) -> None :
Construct variable-precision complex number from another one
- __init__( (object)self, (int_mp)real) -> None :
Construct variable-precision complex number from an arbitrary-precision integer, with 0 imaginary part
- __init__( (object)self, (int_mp)real, (int_mp)imag) -> None :
Construct variable-precision complex number from a pair of arbitrary-precision integers
- dtype = dtype(complex_mp)
- property imag
the imaginary part of the complex number
- property precision
get/set the precision of this variable-precision number, in digits. remember, the system knows not where your number came from, so upsampling will NOT add more correct digits.
- property real
the real part of the complex number
- class bertini.real_mp((object)arg1) None :
Bases:
generic,instanceDefault Construct a variable-precision float
- __init__( (object)self, (str)val) -> None :
Construct a variable-precision float from a string. The best way.
- __init__( (object)self, (int)val) -> None :
Construct a variable-precision float from a regular old integer.
- __init__( (object)self, (real_mp)val) -> None :
Construct a variable-precision float from another.
- __init__( (object)self, (int_mp)val) -> None :
Construct an variable-precision float from an arbitrary-precision integer.
- __init__((object)arg1) None :
Default Construct a variable-precision float
- __init__( (object)self, (str)val) -> None :
Construct a variable-precision float from a string. The best way.
- __init__( (object)self, (int)val) -> None :
Construct a variable-precision float from a regular old integer.
- __init__( (object)self, (real_mp)val) -> None :
Construct a variable-precision float from another.
- __init__( (object)self, (int_mp)val) -> None :
Construct an variable-precision float from an arbitrary-precision integer.
- dtype = dtype(real_mp)
- property precision
get/set the precision of this variable-precision number, in digits. remember, the system knows not where your number came from, so upsampling will NOT add more correct digits.
- class bertini.int_mp((object)arg1) None :
Bases:
instanceDefault Construct an arbitrary-precision integer
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision integer from an integer.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision integer from another.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision integer from a string of digits.
- __init__((object)arg1) None :
Default Construct an arbitrary-precision integer
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision integer from an integer.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision integer from another.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision integer from a string of digits.
- class bertini.rational_mp((object)arg1) None :
Bases:
instanceDefault Construct an arbitrary-precision rational number
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision rational number from an integer.
- __init__( (object)self, (int)numerator, (int)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of integers.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- __init__( (object)self, (int_mp)numerator, (int_mp)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of arbitrary-precision integers.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision rational number from a string, e.g. ‘1/3’.
- __init__( (object)self, (rational_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- __init__((object)arg1) None :
Default Construct an arbitrary-precision rational number
- __init__( (object)self, (int)val) -> None :
Construct an arbitrary-precision rational number from an integer.
- __init__( (object)self, (int)numerator, (int)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of integers.
- __init__( (object)self, (int_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- __init__( (object)self, (int_mp)numerator, (int_mp)denominator) -> None :
Construct an arbitrary-precision rational number from a pair of arbitrary-precision integers.
- __init__( (object)self, (str)val) -> None :
Construct an arbitrary-precision rational number from a string, e.g. ‘1/3’.
- __init__( (object)self, (rational_mp)val) -> None :
Construct an arbitrary-precision rational number from an arbitrary-precision integer.
- bertini.default_precision() int :
get the default precision for variable-precision numbers. is digits, not bits.
- default_precision( (int)arg1) -> None :
set the default precision for variable-precision numbers. should be a positive number. is digits, not bits.
- bertini.ZeroDimSolver(system, *, endgame='cauchy', mptype='adaptive', startsystem='infer', precision=None)[source]
Construct a zero-dim solver by name, with friendly defaults.
ZeroDimSolver(system)is the Cauchy endgame in adaptive precision with the start system inferred from the system’s variable-group structure – total degree for a single affine group, multihomogeneous otherwise – so a multi-group (e.g. eigenvalue) system gets MHom automatically rather than an over-counting total-degree start. Override any piece with a string:ZeroDimSolver(system, endgame='cauchy', mptype='amp', startsystem='mhom')
- Parameters:
system (the polynomial
Systemto solve.)endgame (
'cauchy'(default) or'powerseries'.)mptype (the precision –
'double','multiple', or'adaptive'('amp', the default).)precision (an alias for
mptype; if given (notNone) it overridesmptype.)startsystem (
'infer'(default – choose from the variable-group structure, matching the) – C++ blackbox), or force it with'binomial'/'linearproduct'/'mhom'. To run from a homotopy you built yourself with given start points, useHomotopySolver/blend_homotopy()instead (their construction needs the homotopy and start points, not just a system).solver. (Returns a solver; call .solve() then .all_solutions() as for any zero-dim)
Examples
The default infers the start system; strings pick the rest:
>>> import bertini >>> from bertini.nag_algorithm import ZeroDimSolver >>> x = bertini.Variable('x') >>> sys = bertini.System() >>> sys.add_variable_group(bertini.VariableGroup([x])) >>> sys.add_function(x * x - 1) >>> type(ZeroDimSolver(sys)).__name__ 'ZeroDimSolverCauchyAdaptivePrecision' >>> type(ZeroDimSolver(sys, mptype='amp', startsystem='mhom')).__name__ 'ZeroDimSolverCauchyAdaptivePrecision' >>> solver = ZeroDimSolver(sys, mptype='adaptive') # robust path >>> solver.solve() >>> solver.all_solutions()
- bertini.HomotopySolver(homotopy, start_points, target, *, precision='adaptive', endgame='cauchy')[source]
Track a homotopy you constructed, from a list of start points you already have (e.g. the solutions of an earlier solve) – the continuation primitive (parameter-homotopy workflow).
This reuses the entire tracking pipeline (pre-endgame tracking, the midpath check, the endgame, post-processing); it differs from
ZeroDimSolver()only in that the homotopy and the start points are supplied, not generated.- Parameters:
homotopy (System) – The homotopy to track, with a path variable; tracked from the start time (default 1) down to 0. Its t=1 slice must vanish at the given
start_points.start_points (iterable of vectors) – The start points (at the start time). An earlier solve’s
all_solutions()works directly when the variable coordinates line up (e.g. an affine homotopy).target (System) – The system the solutions satisfy at t=0 – used for dehomogenize / residual and for the solver’s consistency check. It must NOT have a path variable.
precision ({'adaptive', 'double', 'multiple'}) – ‘adaptive’ (default) is the robust path.
endgame ({'cauchy', 'powerseries'})
solver (Returns a)
- class bertini.SolutionPathCollector((object)arg1)[source]
Bases:
CustomObserverCollects each solution path of a ZeroDim solve into its own time series.
Usage:
a = SolutionPathCollector() solver.add_observer(a) solver.solve() for path in a.series: # one tracking.PathDataCollector per solution path t, z = path.times(), path.points() ...
- __init__((object)arg1) None[source]
- Observe(event)[source]
- class bertini.Slice((object)arg1)
Bases:
instanceA linear slice: a stack of linear forms M [x ; 1] that cuts a positive-dimensional component down to witness points. The linear part of a witness set.
A slice is a Python sequence of its linear forms:
len(slice)– the number of forms (the slice’s dimension).slice[i](integer) – the i-th form’s coefficient vector (1-D, length num_variables+1). Iterating yields these vectors. A single linear form is a vector.slice[i:j]/slice[[i, j]]– a sub-Slice (a sub-collection of forms).slice.coefficients()– the whole augmented coefficient matrix, always 2-D(num_forms, num_variables+1).
The vector view vs the matrix view is named (element index vs slice / coefficients), never inferred from the form count – so it is stable regardless of the binding library’s shape conventions (docs/adr/0033).
A slice does NOT own homogenization – the system does.
slice.add_to(system)appends the forms to a system (folding the constant onto the homogenizing variable if the system was homogenized);slice.as_system()returns a standalone System of just the forms. Build slices withSlice.random_complex/Slice.random_real/Slice.from_coefficients(orbertini.bertini.Slice.from_coefficientsfor exact numpy/list coefficients).- __init__((object)arg1) None
- add_to((Slice)self, (bertini._pybertini.system.System)system) None :
add this slice’s linear forms to a System as a linear-forms block
- as_system((Slice)self) bertini._pybertini.system.System :
a standalone System whose functions are exactly this slice’s linear forms
- coefficients()
The augmented coefficient matrix of the slice’s linear forms – always 2-D.
Shape
(num_forms, num_variables + 1): one row per linear form, the trailing column carrying each form’s constant term. This holds even for a single-form slice, where the underlying binding library would otherwise hand back a 1-D array (eigenpy collapses a one-row matrix). The 2-D shape is part of this accessor’s contract – ours, not the binding’s – so it is stable across binding libraries; seedocs/adr/0033. For one form’s coefficient vector, index an element:slice[i].Examples
>>> import bertini >>> import bertini >>> x, y = bertini.Variable('x'), bertini.Variable('y') >>> bertini.Slice.from_coefficients([[2, 3, 1]], [x, y]).coefficients().shape (1, 3)
- concatenate((Slice)self, (Slice)other) Slice :
a new slice stacking this slice’s forms on top of other’s (both on the same variables)
- dimension((Slice)self) int :
the dimension of the slice – the number of linear forms
- eval((Slice)self, (numpy.ndarray)x) numpy.ndarray :
evaluate the linear forms at x, in double precision
- eval( (Slice)self, (numpy.ndarray)x) -> numpy.ndarray :
evaluate the linear forms at x, in multiple precision
- classmethod from_coefficients(coefficients, variables, homogeneous=False)
Build a
Slicefrom an exact augmented coefficient matrix.coefficientsis an(m x n+1)array/list of EXACT values (seebertini.coefficient(); Python floats are refused) – one row per linear form, the trailing column being each form’s constant term (give0there for a homogeneous slice).variablesis the length-nvector of variables the slice is over (a plain list/iterable ofVariable, or aVariableGroup).Returns a
bertini.Slice. Its rows are ready-made factors for a products-of-linears block (seebertini.System.add_slices_as_products()):s = bertini.Slice.from_coefficients([[2, 1, -1]], [x, y]) # 2x + y - 1 = 0
- head((Slice)self, (int)m) Slice :
a new slice over the same variables, built from the first m linear forms
- is_homogeneous((Slice)self) bool :
whether the slice was authored without constant terms
- num_variables((Slice)self) int :
the number of variables the slice is a function of
- precision((Slice)self) int :
get the current working precision of the slice
- precision( (Slice)self, (int)precision) -> None :
set the working precision of the slice
- static random_complex((bertini._pybertini.container.VariableGroup)variables, (int)dim[, (bool)homogeneous=False[, (bool)orthogonal=True]]) Slice :
A random complex linear slice of dim dimensions (forms) on the given variables.
- static random_real((bertini._pybertini.container.VariableGroup)variables, (int)dim[, (bool)homogeneous=False[, (bool)orthogonal=True]]) Slice :
A random real linear slice of dim dimensions (forms) on the given variables.
- rows((Slice)self, (list)indices) Slice :
a new slice over the same variables, built from the chosen linear forms
- tail((Slice)self, (int)m) Slice :
a new slice over the same variables, built from the last m linear forms
- to_classic_input(**kwargs)
Emit this slice’s linear forms as a Bertini 1 classic input file (see System.to_classic_input).
- class bertini.AMPTracker((object)arg1, (bertini._pybertini.system.System)arg2)
Bases:
ObservableThe adaptive multiple precision (AMP) tracker. Ambient numeric type is multiple-precision (complex_mp). Contruct one by feeding it a system – cannot be constructed without feeding it a system. Adjust its settings via configs and the setup function. Then, call method track_path.
- __init__((object)arg1, (bertini._pybertini.system.System)arg2) None
- add_observer((object)self, (object)observer) None :
Attach an observer to this observable object
- config_names()
The keyword names accepted by configure() for this owner.
- config_types((AMPTracker)self) list :
List the configuration struct classes this object accepts.
- configure(**kwargs)
Change settings on this owner’s configs in one call.
Each keyword names a config (e.g.
stepping,newton,tolerances); its value is either a dict of fields to change, or a ready config object.- tracker.configure(stepping={‘max_step_size’: 0.1},
newton={‘max_num_newton_iterations’: 2})
Returns self.
- current_point((AMPTracker)self) numpy.ndarray :
what is the current point?
- current_precision((AMPTracker)self) int :
what is the current working precision?
- current_stepsize((AMPTracker)self) bertini._pybertini.multiprec.real_mp :
what is the current stepsize? a real number.
- current_time((AMPTracker)self) bertini._pybertini.multiprec.complex_mp :
what is the current time?
- delta_t((AMPTracker)self) bertini._pybertini.multiprec.complex_mp :
what is the current delta_t, the time increment of the latest step? a complex number.
- get_config((AMPTracker)self, (object)config_type) object :
Return a copy of this object’s stored configuration struct of the given class.
- get_newton((AMPTracker)self) NewtonConfig :
Get the tracker’s internal configuration for Newton correction
- get_settings()
This owner’s whole configuration as a carryable dict
{config_name: config}.Each value is a copy of one of the owner’s configs (e.g.
{'stepping': SteppingConfig(...), 'tolerances': TolerancesConfig(...)}), keyed by the same short names config_names() lists. The configs are independent copies (and picklable), so the dict is a plain Python value you can stash, tweak, and apply to other owners – the way to carry one set of tracking settings across a series of related solves:settings = first_solver.get_settings() next_solver.set_settings(settings)
See set_settings() for applying one back.
- get_stepping((AMPTracker)self) SteppingConfig :
Get the tracker’s internal configuration for things that control stepping behaviour
- get_system((AMPTracker)arg1) bertini._pybertini.system.System :
Gets an internal reference to the tracked system.
- infinite_truncation((AMPTracker)self, (bool)val) None :
Decide whether the tracker should truncate infinite paths. See also infinite_truncation_tolerance
- infinite_truncation( (AMPTracker)self) -> bool :
Get the bool for whether the tracker should truncate infinite paths. See also infinite_truncation_tolerance
- infinite_truncation_tolerance((AMPTracker)self, (float)tol) None :
Set the path truncation tolerance for infinite paths for the tracker
- infinite_truncation_tolerance( (AMPTracker)self) -> float :
Get the path truncation tolerance for infinite paths for the tracker
- latest_condition_number((AMPTracker)self) float :
the most recent estimate of the condition number of the Jacobian. a real number.
- latest_error_estimate((AMPTracker)self) float :
the most recent estimate of the error of a step. a real number.
- latest_norm_of_step((AMPTracker)self) float :
the norm of the change in space resulting from the most recent step. a real number.
- num_total_steps_taken((AMPTracker)self) int :
Ask how many steps have been taken so far, including failures
- observers = <module 'bertini._pybertini.tracking.observers.amp'>
- precision_preservation((AMPTracker)arg1, (bool)arg2) None :
Turn on or off the preservation of precision. That is, if this is on (true), then the precision of the final point will be the precision of the start point. Generally, you want to let precision drift, methinks.
- precision_setup((AMPTracker)arg1, (AMPConfig)arg2) None
- predictor((AMPTracker)self) Predictor :
Query the current predictor method used by the tracker.
- predictor( (AMPTracker)self, (Predictor)predictor) -> None :
Set the predictor method used by the tracker.
- refine((AMPTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (complex)time) SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- refine( (AMPTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (bertini._pybertini.multiprec.complex_mp)time) -> SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- refine( (AMPTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (complex)time, (float)tolerance, (int)max_iterations) -> SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- refine( (AMPTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (bertini._pybertini.multiprec.complex_mp)time, (float)tolerance, (int)max_iterations) -> SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- reinitialize_initial_step_size((AMPTracker)self, (bool)val) None :
Set whether the tracker should re-set the stepsize to the configured-initial stepsize when it starts tracking. Feed it a bool
- remove_observer((object)self, (object)observer) None :
Remove an observer to this observable object
- set(**fields)
Set config fields on this owner by NAME, each routed to whichever config owns it.
You never name the config struct:
solver.update(final_tolerance="1e-11", # -> TolerancesConfig max_num_crossed_path_resolve_attempts=3) # -> ZeroDimConfig
Strings work for every numeric field (converted exactly). A field that none of this owner’s configs has raises AttributeError with the valid names – so a typo, or trying to set a tracker field on the algorithm (or vice versa), never silently does nothing. Returns self, so calls chain. To set a whole config at once, or to name the config explicitly, use configure().
- set_config((AMPTracker)self, (SteppingConfig)config) None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_config( (AMPTracker)self, (NewtonConfig)config) -> None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_config( (AMPTracker)self, (AMPConfig)config) -> None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_newton((AMPTracker)self, (NewtonConfig)config) None :
Set the tracker’s internal configuration for Newton correction
- set_settings(settings, strict=False)
Apply a settings dict (from get_settings()) onto this owner. Returns self.
settingsis{config_name: config}(or{config_name: {field: value}}). By default only the configs this owner actually has are applied and the rest are skipped – so a bundle carried from one solver drops cleanly onto another whose config set differs (e.g. a different precision model, or a different algorithm stage). Passstrict=Trueto instead raise on any key this owner does not have.
- set_stepping((AMPTracker)self, (SteppingConfig)config) None :
Set the tracker’s internal configuration for things that control stepping behaviour
- set_stepsize((AMPTracker)self, (bertini._pybertini.multiprec.real_mp)stepsize) None :
Set the stepsize for the tracker
- setup((AMPTracker)arg1, (Predictor)predictor, (float)tolerance, (float)truncation, (SteppingConfig)stepping, (NewtonConfig)newton) None :
Set values for the internal configuration of the tracker. tolerance and truncation are both real doubles. predictor is a valid value for predictor choice. stepping and newton are the config structs from bertini.tracking.
- track_path((AMPTracker)self, (object)result, (bertini._pybertini.multiprec.complex_mp)start_time, (bertini._pybertini.multiprec.complex_mp)end_time, (numpy.ndarray)start_point) SuccessCode :
The main function of the tracker, once its set up. The first argument is the output. Feed it, in (result, start_time, end_time, start_point
- tracking_tolerance((AMPTracker)self) float :
Get. A step is labeled as a failure if newton correcting doesn’t yield a residual less than this tolerance. A real number, the smaller the slower tracking, generally speaking
- tracking_tolerance( (AMPTracker)self, (float)tol) -> None :
Set the tracking tolerance for the tracker
- update(**fields)
Set config fields on this owner by NAME, each routed to whichever config owns it.
You never name the config struct:
solver.update(final_tolerance="1e-11", # -> TolerancesConfig max_num_crossed_path_resolve_attempts=3) # -> ZeroDimConfig
Strings work for every numeric field (converted exactly). A field that none of this owner’s configs has raises AttributeError with the valid names – so a typo, or trying to set a tracker field on the algorithm (or vice versa), never silently does nothing. Returns self, so calls chain. To set a whole config at once, or to name the config explicitly, use configure().
- class bertini.DoublePrecisionTracker((object)arg1, (bertini._pybertini.system.System)arg2)
Bases:
ObservableThe double precision tracker. Tracks using only complex doubles. Ambient numeric type is double. Contruct one by feeding it a system – cannot be constructed without feeding it a system. Adjust its settings via configs and the setup function. Then, call method track_path.
- __init__((object)arg1, (bertini._pybertini.system.System)arg2) None
- add_observer((object)self, (object)observer) None :
Attach an observer to this observable object
- config_names()
The keyword names accepted by configure() for this owner.
- config_types((DoublePrecisionTracker)self) list :
List the configuration struct classes this object accepts.
- configure(**kwargs)
Change settings on this owner’s configs in one call.
Each keyword names a config (e.g.
stepping,newton,tolerances); its value is either a dict of fields to change, or a ready config object.- tracker.configure(stepping={‘max_step_size’: 0.1},
newton={‘max_num_newton_iterations’: 2})
Returns self.
- current_point((DoublePrecisionTracker)self) numpy.ndarray :
what is the current point?
- current_precision((DoublePrecisionTracker)self) int :
what is the current working precision?
- current_stepsize((DoublePrecisionTracker)self) float :
what is the current stepsize? a real number.
- current_time((DoublePrecisionTracker)self) complex :
what is the current time?
- delta_t((DoublePrecisionTracker)self) complex :
what is the current delta_t, the time increment of the latest step? a complex number.
- get_config((DoublePrecisionTracker)self, (object)config_type) object :
Return a copy of this object’s stored configuration struct of the given class.
- get_newton((DoublePrecisionTracker)self) NewtonConfig :
Get the tracker’s internal configuration for Newton correction
- get_settings()
This owner’s whole configuration as a carryable dict
{config_name: config}.Each value is a copy of one of the owner’s configs (e.g.
{'stepping': SteppingConfig(...), 'tolerances': TolerancesConfig(...)}), keyed by the same short names config_names() lists. The configs are independent copies (and picklable), so the dict is a plain Python value you can stash, tweak, and apply to other owners – the way to carry one set of tracking settings across a series of related solves:settings = first_solver.get_settings() next_solver.set_settings(settings)
See set_settings() for applying one back.
- get_stepping((DoublePrecisionTracker)self) SteppingConfig :
Get the tracker’s internal configuration for things that control stepping behaviour
- get_system((DoublePrecisionTracker)arg1) bertini._pybertini.system.System :
Gets an internal reference to the tracked system.
- infinite_truncation((DoublePrecisionTracker)self, (bool)val) None :
Decide whether the tracker should truncate infinite paths. See also infinite_truncation_tolerance
- infinite_truncation( (DoublePrecisionTracker)self) -> bool :
Get the bool for whether the tracker should truncate infinite paths. See also infinite_truncation_tolerance
- infinite_truncation_tolerance((DoublePrecisionTracker)self, (float)tol) None :
Set the path truncation tolerance for infinite paths for the tracker
- infinite_truncation_tolerance( (DoublePrecisionTracker)self) -> float :
Get the path truncation tolerance for infinite paths for the tracker
- latest_condition_number((DoublePrecisionTracker)self) float :
the most recent estimate of the condition number of the Jacobian. a real number.
- latest_error_estimate((DoublePrecisionTracker)self) float :
the most recent estimate of the error of a step. a real number.
- latest_norm_of_step((DoublePrecisionTracker)self) float :
the norm of the change in space resulting from the most recent step. a real number.
- num_total_steps_taken((DoublePrecisionTracker)self) int :
Ask how many steps have been taken so far, including failures
- observers = <module 'bertini._pybertini.tracking.observers.double'>
- predictor((DoublePrecisionTracker)self) Predictor :
Query the current predictor method used by the tracker.
- predictor( (DoublePrecisionTracker)self, (Predictor)predictor) -> None :
Set the predictor method used by the tracker.
- refine((DoublePrecisionTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (complex)time) SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- refine( (DoublePrecisionTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (complex)time, (float)tolerance, (int)max_iterations) -> SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- reinitialize_initial_step_size((DoublePrecisionTracker)self, (bool)val) None :
Set whether the tracker should re-set the stepsize to the configured-initial stepsize when it starts tracking. Feed it a bool
- remove_observer((object)self, (object)observer) None :
Remove an observer to this observable object
- set(**fields)
Set config fields on this owner by NAME, each routed to whichever config owns it.
You never name the config struct:
solver.update(final_tolerance="1e-11", # -> TolerancesConfig max_num_crossed_path_resolve_attempts=3) # -> ZeroDimConfig
Strings work for every numeric field (converted exactly). A field that none of this owner’s configs has raises AttributeError with the valid names – so a typo, or trying to set a tracker field on the algorithm (or vice versa), never silently does nothing. Returns self, so calls chain. To set a whole config at once, or to name the config explicitly, use configure().
- set_config((DoublePrecisionTracker)self, (SteppingConfig)config) None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_config( (DoublePrecisionTracker)self, (NewtonConfig)config) -> None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_config( (DoublePrecisionTracker)self, (FixedPrecisionConfig)config) -> None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_newton((DoublePrecisionTracker)self, (NewtonConfig)config) None :
Set the tracker’s internal configuration for Newton correction
- set_settings(settings, strict=False)
Apply a settings dict (from get_settings()) onto this owner. Returns self.
settingsis{config_name: config}(or{config_name: {field: value}}). By default only the configs this owner actually has are applied and the rest are skipped – so a bundle carried from one solver drops cleanly onto another whose config set differs (e.g. a different precision model, or a different algorithm stage). Passstrict=Trueto instead raise on any key this owner does not have.
- set_stepping((DoublePrecisionTracker)self, (SteppingConfig)config) None :
Set the tracker’s internal configuration for things that control stepping behaviour
- set_stepsize((DoublePrecisionTracker)self, (float)stepsize) None :
Set the stepsize for the tracker
- setup((DoublePrecisionTracker)arg1, (Predictor)predictor, (float)tolerance, (float)truncation, (SteppingConfig)stepping, (NewtonConfig)newton) None :
Set values for the internal configuration of the tracker. tolerance and truncation are both real doubles. predictor is a valid value for predictor choice. stepping and newton are the config structs from bertini.tracking.
- track_path((DoublePrecisionTracker)self, (object)result, (complex)start_time, (complex)end_time, (numpy.ndarray)start_point) SuccessCode :
The main function of the tracker, once its set up. The first argument is the output. Feed it, in (result, start_time, end_time, start_point
- tracking_tolerance((DoublePrecisionTracker)self) float :
Get. A step is labeled as a failure if newton correcting doesn’t yield a residual less than this tolerance. A real number, the smaller the slower tracking, generally speaking
- tracking_tolerance( (DoublePrecisionTracker)self, (float)tol) -> None :
Set the tracking tolerance for the tracker
- update(**fields)
Set config fields on this owner by NAME, each routed to whichever config owns it.
You never name the config struct:
solver.update(final_tolerance="1e-11", # -> TolerancesConfig max_num_crossed_path_resolve_attempts=3) # -> ZeroDimConfig
Strings work for every numeric field (converted exactly). A field that none of this owner’s configs has raises AttributeError with the valid names – so a typo, or trying to set a tracker field on the algorithm (or vice versa), never silently does nothing. Returns self, so calls chain. To set a whole config at once, or to name the config explicitly, use configure().
- class bertini.MultiplePrecisionTracker((object)arg1, (bertini._pybertini.system.System)arg2)
Bases:
ObservableThe fixed multiple precision tracker. Ambient numeric type is multiple-precision (complex_mp). Precision is the value of bertini.default_precision() at contruction. Errors if you try to feed it things not at that precision. Contruct one by feeding it a system – cannot be constructed without feeding it a system. Adjust its settings via configs and the setup function. Then, call method track_path.
- __init__((object)arg1, (bertini._pybertini.system.System)arg2) None
- add_observer((object)self, (object)observer) None :
Attach an observer to this observable object
- config_names()
The keyword names accepted by configure() for this owner.
- config_types((MultiplePrecisionTracker)self) list :
List the configuration struct classes this object accepts.
- configure(**kwargs)
Change settings on this owner’s configs in one call.
Each keyword names a config (e.g.
stepping,newton,tolerances); its value is either a dict of fields to change, or a ready config object.- tracker.configure(stepping={‘max_step_size’: 0.1},
newton={‘max_num_newton_iterations’: 2})
Returns self.
- current_point((MultiplePrecisionTracker)self) numpy.ndarray :
what is the current point?
- current_precision((MultiplePrecisionTracker)self) int :
what is the current working precision?
- current_stepsize((MultiplePrecisionTracker)self) bertini._pybertini.multiprec.real_mp :
what is the current stepsize? a real number.
- current_time((MultiplePrecisionTracker)self) bertini._pybertini.multiprec.complex_mp :
what is the current time?
- delta_t((MultiplePrecisionTracker)self) bertini._pybertini.multiprec.complex_mp :
what is the current delta_t, the time increment of the latest step? a complex number.
- get_config((MultiplePrecisionTracker)self, (object)config_type) object :
Return a copy of this object’s stored configuration struct of the given class.
- get_newton((MultiplePrecisionTracker)self) NewtonConfig :
Get the tracker’s internal configuration for Newton correction
- get_settings()
This owner’s whole configuration as a carryable dict
{config_name: config}.Each value is a copy of one of the owner’s configs (e.g.
{'stepping': SteppingConfig(...), 'tolerances': TolerancesConfig(...)}), keyed by the same short names config_names() lists. The configs are independent copies (and picklable), so the dict is a plain Python value you can stash, tweak, and apply to other owners – the way to carry one set of tracking settings across a series of related solves:settings = first_solver.get_settings() next_solver.set_settings(settings)
See set_settings() for applying one back.
- get_stepping((MultiplePrecisionTracker)self) SteppingConfig :
Get the tracker’s internal configuration for things that control stepping behaviour
- get_system((MultiplePrecisionTracker)arg1) bertini._pybertini.system.System :
Gets an internal reference to the tracked system.
- infinite_truncation((MultiplePrecisionTracker)self, (bool)val) None :
Decide whether the tracker should truncate infinite paths. See also infinite_truncation_tolerance
- infinite_truncation( (MultiplePrecisionTracker)self) -> bool :
Get the bool for whether the tracker should truncate infinite paths. See also infinite_truncation_tolerance
- infinite_truncation_tolerance((MultiplePrecisionTracker)self, (float)tol) None :
Set the path truncation tolerance for infinite paths for the tracker
- infinite_truncation_tolerance( (MultiplePrecisionTracker)self) -> float :
Get the path truncation tolerance for infinite paths for the tracker
- latest_condition_number((MultiplePrecisionTracker)self) float :
the most recent estimate of the condition number of the Jacobian. a real number.
- latest_error_estimate((MultiplePrecisionTracker)self) float :
the most recent estimate of the error of a step. a real number.
- latest_norm_of_step((MultiplePrecisionTracker)self) float :
the norm of the change in space resulting from the most recent step. a real number.
- num_total_steps_taken((MultiplePrecisionTracker)self) int :
Ask how many steps have been taken so far, including failures
- observers = <module 'bertini._pybertini.tracking.observers.multiple'>
- predictor((MultiplePrecisionTracker)self) Predictor :
Query the current predictor method used by the tracker.
- predictor( (MultiplePrecisionTracker)self, (Predictor)predictor) -> None :
Set the predictor method used by the tracker.
- refine((MultiplePrecisionTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (bertini._pybertini.multiprec.complex_mp)time) SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- refine( (MultiplePrecisionTracker)self, (numpy.ndarray)result, (numpy.ndarray)start_point, (bertini._pybertini.multiprec.complex_mp)time, (float)tolerance, (int)max_iterations) -> SuccessCode :
refine a point using this tracker, from start_point, at fixed time. returns a success code, computed refined point is in result.
- reinitialize_initial_step_size((MultiplePrecisionTracker)self, (bool)val) None :
Set whether the tracker should re-set the stepsize to the configured-initial stepsize when it starts tracking. Feed it a bool
- remove_observer((object)self, (object)observer) None :
Remove an observer to this observable object
- set(**fields)
Set config fields on this owner by NAME, each routed to whichever config owns it.
You never name the config struct:
solver.update(final_tolerance="1e-11", # -> TolerancesConfig max_num_crossed_path_resolve_attempts=3) # -> ZeroDimConfig
Strings work for every numeric field (converted exactly). A field that none of this owner’s configs has raises AttributeError with the valid names – so a typo, or trying to set a tracker field on the algorithm (or vice versa), never silently does nothing. Returns self, so calls chain. To set a whole config at once, or to name the config explicitly, use configure().
- set_config((MultiplePrecisionTracker)self, (SteppingConfig)config) None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_config( (MultiplePrecisionTracker)self, (NewtonConfig)config) -> None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_config( (MultiplePrecisionTracker)self, (FixedPrecisionConfig)config) -> None :
Store one of this object’s configuration structs (dispatched by the config’s type).
- set_newton((MultiplePrecisionTracker)self, (NewtonConfig)config) None :
Set the tracker’s internal configuration for Newton correction
- set_settings(settings, strict=False)
Apply a settings dict (from get_settings()) onto this owner. Returns self.
settingsis{config_name: config}(or{config_name: {field: value}}). By default only the configs this owner actually has are applied and the rest are skipped – so a bundle carried from one solver drops cleanly onto another whose config set differs (e.g. a different precision model, or a different algorithm stage). Passstrict=Trueto instead raise on any key this owner does not have.
- set_stepping((MultiplePrecisionTracker)self, (SteppingConfig)config) None :
Set the tracker’s internal configuration for things that control stepping behaviour
- set_stepsize((MultiplePrecisionTracker)self, (bertini._pybertini.multiprec.real_mp)stepsize) None :
Set the stepsize for the tracker
- setup((MultiplePrecisionTracker)arg1, (Predictor)predictor, (float)tolerance, (float)truncation, (SteppingConfig)stepping, (NewtonConfig)newton) None :
Set values for the internal configuration of the tracker. tolerance and truncation are both real doubles. predictor is a valid value for predictor choice. stepping and newton are the config structs from bertini.tracking.
- track_path((MultiplePrecisionTracker)self, (object)result, (bertini._pybertini.multiprec.complex_mp)start_time, (bertini._pybertini.multiprec.complex_mp)end_time, (numpy.ndarray)start_point) SuccessCode :
The main function of the tracker, once its set up. The first argument is the output. Feed it, in (result, start_time, end_time, start_point
- tracking_tolerance((MultiplePrecisionTracker)self) float :
Get. A step is labeled as a failure if newton correcting doesn’t yield a residual less than this tolerance. A real number, the smaller the slower tracking, generally speaking
- tracking_tolerance( (MultiplePrecisionTracker)self, (float)tol) -> None :
Set the tracking tolerance for the tracker
- update(**fields)
Set config fields on this owner by NAME, each routed to whichever config owns it.
You never name the config struct:
solver.update(final_tolerance="1e-11", # -> TolerancesConfig max_num_crossed_path_resolve_attempts=3) # -> ZeroDimConfig
Strings work for every numeric field (converted exactly). A field that none of this owner’s configs has raises AttributeError with the valid names – so a typo, or trying to set a tracker field on the algorithm (or vice versa), never silently does nothing. Returns self, so calls chain. To set a whole config at once, or to name the config explicitly, use configure().
- class bertini.SuccessCode
Bases:
enum- CycleNumTooHigh = bertini._pybertini.tracking.SuccessCode.CycleNumTooHigh
- ExternallyTerminated = bertini._pybertini.tracking.SuccessCode.ExternallyTerminated
- FailedToConverge = bertini._pybertini.tracking.SuccessCode.FailedToConverge
- FailedToSelectPrecisionAndStepsize = bertini._pybertini.tracking.SuccessCode.FailedToSelectPrecisionAndStepsize
- Failure = bertini._pybertini.tracking.SuccessCode.Failure
- GoingToInfinity = bertini._pybertini.tracking.SuccessCode.GoingToInfinity
- HigherPrecisionNecessary = bertini._pybertini.tracking.SuccessCode.HigherPrecisionNecessary
- MatrixSolveFailure = bertini._pybertini.tracking.SuccessCode.MatrixSolveFailure
- MatrixSolveFailureFirstPartOfPrediction = bertini._pybertini.tracking.SuccessCode.MatrixSolveFailureFirstPartOfPrediction
- MaxNumStepsTaken = bertini._pybertini.tracking.SuccessCode.MaxNumStepsTaken
- MaxPrecisionReached = bertini._pybertini.tracking.SuccessCode.MaxPrecisionReached
- MinStepSizeReached = bertini._pybertini.tracking.SuccessCode.MinStepSizeReached
- MinTrackTimeReached = bertini._pybertini.tracking.SuccessCode.MinTrackTimeReached
- ReduceStepSize = bertini._pybertini.tracking.SuccessCode.ReduceStepSize
- SecurityMaxNormReached = bertini._pybertini.tracking.SuccessCode.SecurityMaxNormReached
- SingularStartPoint = bertini._pybertini.tracking.SuccessCode.SingularStartPoint
- Success = bertini._pybertini.tracking.SuccessCode.Success
- names = {'CycleNumTooHigh': bertini._pybertini.tracking.SuccessCode.CycleNumTooHigh, 'ExternallyTerminated': bertini._pybertini.tracking.SuccessCode.ExternallyTerminated, 'FailedToConverge': bertini._pybertini.tracking.SuccessCode.FailedToConverge, 'FailedToSelectPrecisionAndStepsize': bertini._pybertini.tracking.SuccessCode.FailedToSelectPrecisionAndStepsize, 'Failure': bertini._pybertini.tracking.SuccessCode.Failure, 'GoingToInfinity': bertini._pybertini.tracking.SuccessCode.GoingToInfinity, 'HigherPrecisionNecessary': bertini._pybertini.tracking.SuccessCode.HigherPrecisionNecessary, 'MatrixSolveFailure': bertini._pybertini.tracking.SuccessCode.MatrixSolveFailure, 'MatrixSolveFailureFirstPartOfPrediction': bertini._pybertini.tracking.SuccessCode.MatrixSolveFailureFirstPartOfPrediction, 'MaxNumStepsTaken': bertini._pybertini.tracking.SuccessCode.MaxNumStepsTaken, 'MaxPrecisionReached': bertini._pybertini.tracking.SuccessCode.MaxPrecisionReached, 'MinStepSizeReached': bertini._pybertini.tracking.SuccessCode.MinStepSizeReached, 'MinTrackTimeReached': bertini._pybertini.tracking.SuccessCode.MinTrackTimeReached, 'ReduceStepSize': bertini._pybertini.tracking.SuccessCode.ReduceStepSize, 'SecurityMaxNormReached': bertini._pybertini.tracking.SuccessCode.SecurityMaxNormReached, 'SingularStartPoint': bertini._pybertini.tracking.SuccessCode.SingularStartPoint, 'Success': bertini._pybertini.tracking.SuccessCode.Success}
- values = {0: bertini._pybertini.tracking.SuccessCode.Success, 1: bertini._pybertini.tracking.SuccessCode.HigherPrecisionNecessary, 2: bertini._pybertini.tracking.SuccessCode.ReduceStepSize, 3: bertini._pybertini.tracking.SuccessCode.GoingToInfinity, 4: bertini._pybertini.tracking.SuccessCode.FailedToConverge, 5: bertini._pybertini.tracking.SuccessCode.MatrixSolveFailure, 6: bertini._pybertini.tracking.SuccessCode.MatrixSolveFailureFirstPartOfPrediction, 7: bertini._pybertini.tracking.SuccessCode.MaxNumStepsTaken, 8: bertini._pybertini.tracking.SuccessCode.MaxPrecisionReached, 9: bertini._pybertini.tracking.SuccessCode.MinStepSizeReached, 10: bertini._pybertini.tracking.SuccessCode.Failure, 11: bertini._pybertini.tracking.SuccessCode.SingularStartPoint, 12: bertini._pybertini.tracking.SuccessCode.ExternallyTerminated, 13: bertini._pybertini.tracking.SuccessCode.MinTrackTimeReached, 14: bertini._pybertini.tracking.SuccessCode.SecurityMaxNormReached, 15: bertini._pybertini.tracking.SuccessCode.CycleNumTooHigh, 16: bertini._pybertini.tracking.SuccessCode.FailedToSelectPrecisionAndStepsize}
- class bertini.Predictor
Bases:
enum- Constant = bertini._pybertini.tracking.Predictor.Constant
- Euler = bertini._pybertini.tracking.Predictor.Euler
- Heun = bertini._pybertini.tracking.Predictor.Heun
- HeunEuler = bertini._pybertini.tracking.Predictor.HeunEuler
- RK4 = bertini._pybertini.tracking.Predictor.RK4
- RKCashKarp45 = bertini._pybertini.tracking.Predictor.RKCashKarp45
- RKDormandPrince56 = bertini._pybertini.tracking.Predictor.RKDormandPrince56
- RKF45 = bertini._pybertini.tracking.Predictor.RKF45
- RKNorsett34 = bertini._pybertini.tracking.Predictor.RKNorsett34
- RKVerner67 = bertini._pybertini.tracking.Predictor.RKVerner67
- names = {'Constant': bertini._pybertini.tracking.Predictor.Constant, 'Euler': bertini._pybertini.tracking.Predictor.Euler, 'Heun': bertini._pybertini.tracking.Predictor.Heun, 'HeunEuler': bertini._pybertini.tracking.Predictor.HeunEuler, 'RK4': bertini._pybertini.tracking.Predictor.RK4, 'RKCashKarp45': bertini._pybertini.tracking.Predictor.RKCashKarp45, 'RKDormandPrince56': bertini._pybertini.tracking.Predictor.RKDormandPrince56, 'RKF45': bertini._pybertini.tracking.Predictor.RKF45, 'RKNorsett34': bertini._pybertini.tracking.Predictor.RKNorsett34, 'RKVerner67': bertini._pybertini.tracking.Predictor.RKVerner67}
- values = {0: bertini._pybertini.tracking.Predictor.Constant, 1: bertini._pybertini.tracking.Predictor.Euler, 2: bertini._pybertini.tracking.Predictor.Heun, 3: bertini._pybertini.tracking.Predictor.RK4, 4: bertini._pybertini.tracking.Predictor.HeunEuler, 5: bertini._pybertini.tracking.Predictor.RKNorsett34, 6: bertini._pybertini.tracking.Predictor.RKF45, 7: bertini._pybertini.tracking.Predictor.RKCashKarp45, 8: bertini._pybertini.tracking.Predictor.RKDormandPrince56, 9: bertini._pybertini.tracking.Predictor.RKVerner67}
- class bertini.MonomialOrder
Bases:
enumthe monomial order used to canonically order Sum/Mult operands
- GrevLex = bertini._pybertini.function_tree.MonomialOrder.GrevLex
- Lex = bertini._pybertini.function_tree.MonomialOrder.Lex
- RevLex = bertini._pybertini.function_tree.MonomialOrder.RevLex
- names = {'GrevLex': bertini._pybertini.function_tree.MonomialOrder.GrevLex, 'Lex': bertini._pybertini.function_tree.MonomialOrder.Lex, 'RevLex': bertini._pybertini.function_tree.MonomialOrder.RevLex}
- values = {0: bertini._pybertini.function_tree.MonomialOrder.Lex, 1: bertini._pybertini.function_tree.MonomialOrder.RevLex, 2: bertini._pybertini.function_tree.MonomialOrder.GrevLex}
- class bertini.StartSystemType
Bases:
enumWhich start system a ZeroDim solver builds: total_degree_binomial (the default for 1-homogeneous systems), total_degree_linear_product, or mhomogeneous. User homotopies use nag_algorithm.user_homotopy(…) instead.
- mhomogeneous = bertini._pybertini.nag_algorithms.StartSystemType.mhomogeneous
- names = {'mhomogeneous': bertini._pybertini.nag_algorithms.StartSystemType.mhomogeneous, 'total_degree_binomial': bertini._pybertini.nag_algorithms.StartSystemType.total_degree_binomial, 'total_degree_linear_product': bertini._pybertini.nag_algorithms.StartSystemType.total_degree_linear_product}
- total_degree_binomial = bertini._pybertini.nag_algorithms.StartSystemType.total_degree_binomial
- total_degree_linear_product = bertini._pybertini.nag_algorithms.StartSystemType.total_degree_linear_product
- values = {0: bertini._pybertini.nag_algorithms.StartSystemType.total_degree_linear_product, 1: bertini._pybertini.nag_algorithms.StartSystemType.total_degree_binomial, 2: bertini._pybertini.nag_algorithms.StartSystemType.mhomogeneous}
- bertini.sin((AbstractNode)arg1) AbstractNode :
the symbolic sine operator
- bertini.cos((AbstractNode)arg1) AbstractNode :
the symbolic cosine operator
- bertini.tan((AbstractNode)arg1) AbstractNode :
the symbolic tangent operator
- bertini.asin((AbstractNode)arg1) AbstractNode :
the symbolic arcsine operator
- bertini.acos((AbstractNode)arg1) AbstractNode :
the symbolic arccosine operator
- bertini.atan((AbstractNode)arg1) AbstractNode :
the symbolic arctangent operator
- bertini.exp((AbstractNode)arg1) AbstractNode :
the symbolic exponential operator
- bertini.log((AbstractNode)arg1) AbstractNode :
the symbolic natural log operator
- bertini.sqrt(x)[source]
Symbolic square-root operator.
- bertini.canonicalize() bool :
whether Sum/Mult operands are canonically ordered, so x+y and y+x are one node
- canonicalize( (bool)on) -> None :
enable/disable canonical operand ordering, session-global (the per-expression opt-out)
- bertini.monomial_order() MonomialOrder :
the current monomial order used for canonicalization
- monomial_order( (MonomialOrder)order) -> None :
set the monomial order (Lex/RevLex/GrevLex), session-global
Submodules
Various algorithms for numerical algebraic geometry, notable the zero dimensional algorithm, which is used all over the place. |
|
Reusable, low-friction ergonomics for Bertini config structs. |
|
Endgame-specific things -- endgames, configs |
|
Parsing functions, taking strings and producing various other things |
|
Multiprecision types, and functions that operate on them. |
|
nag_algorithms |
|
The symbolic math vocabulary, gathered for |
|
MPI parallelism support for Bertini2. |
|
Parsing functions, taking strings and producing various other things |
|
The casual face of the structured output directory: |
|
The symbolic expression system for building polynomial systems -- a FLAT namespace. |
|
Exact two-way conversion between sympy expressions and bertini function trees. |
|
Provides utilities for working with systems of functions -- polynomials are intended, although you can work with functions involving things like trig functions, arbitrary powers, etc. |
|
Tracking-specific things -- trackers, configs |
|