alhambra.fastreduce
#
Module Contents#
Classes#
Functions#
|
|
|
|
|
|
|
|
|
Calculate potential tile attachments to input neighborhoods |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Apply tile reduction algorithm, preserving some set of properties, and using a multiprocessing pool. |
|
Apply end reduction algorithm, preserving some set of properties, and using a multiprocessing pool. |
Attributes#
- alhambra.fastreduce._ffakedouble_n(tn, sta, gluelist, outputonly=True, dir4=False, equiv=None)[source]#
- alhambra.fastreduce.ptins(fts, equiv=None, tau=2)[source]#
Calculate potential tile attachments to input neighborhoods
- alhambra.fastreduce.is_2go_single_nn(fts, tn, un, equiv, tau=2, in2go=None, retall=False, also22go=False)[source]#
- alhambra.fastreduce._recfix(fts, equiv, tp, initptins, check2go=False, ins2go=None, orig2go=None, orig22go=None, check22go=False, checkld=False, chain=None, preserveuse=False)[source]#
- alhambra.fastreduce._tilereduce(fts, equiv=None, check2go=False, initptins=None, check22go=False, checkld=False, preserveuse=False)[source]#
- alhambra.fastreduce._gluereduce(fts, equiv=None, check2go=False, check22go=False, checkld=False, initptins=None, preserveuse=False)[source]#
- alhambra.fastreduce.reduce_tiles(tileset, preserve=('s22', 'ld'), tries=10, threads=1, returntype='equiv', best=1, key=None, initequiv=None)[source]#
Apply tile reduction algorithm, preserving some set of properties, and using a multiprocessing pool.
- Parameters:
tileset (TileSet) – The system to reduce.
preserve (a tuple or list of strings, optional) – The properties to preserve. Currently supported are ‘s1’ for first order sensitivity, ‘s2’ for second order sensitivity, ‘s22’ for two-by-two sensitivity, ‘ld’ for small lattice defects, and ‘gs’ for glue sense (to avoid spurious hierarchical attachment). Default is currently (‘s22’, ‘ld’).
tries (int, optional) – The number of times to run the algorithm.
threads (int, optional) – The number of threads to use (using multiprocessing).
returntype ('TileSet' or 'equiv' (default 'equiv')) – The type of object to return. If ‘equiv’, returns an array of glue equivalences (or list, if best != 1) that can be applied to the tileset with apply_equiv, or used for further reduction. If ‘TileSet’, return a TileSet with the equiv already applied (or a list, if best != 1).
best (int or None, optional) – The number of systems to return. If 1, the result will be returned directly; if k > 1, a list will be returned of the best k results (per cmp); if k = None, a list of all results will be returned, sorted by cmp. (default 1)
key (function (ts, equiv1, equiv2) -> some number/comparable) – A comparison function for equivs, to sort the results. FIXME: documentation needed. Default (if None) here is to sort by number of glues in the system, regardless of number of tiles.
initequiv (equiv) – If provided, the equivalence array to start from. If None, start from the tileset without any merged glues.
- Returns:
reduced – The reduced system/systems
- Return type:
single TileSet
- alhambra.fastreduce.reduce_ends(tileset, preserve=('s22', 'ld'), tries=10, threads=1, returntype='equiv', best=1, key=None, initequiv=None)[source]#
Apply end reduction algorithm, preserving some set of properties, and using a multiprocessing pool.
- Parameters:
tileset (TileSet) – The system to reduce.
preserve (a tuple or list of strings, optional) – The properties to preserve. Currently supported are ‘s1’ for first order sensitivity, ‘s2’ for second order sensitivity, ‘s22’ for two-by-two sensitivity, ‘ld’ for small lattice defects, and ‘gs’ for glue sense (to avoid spurious hierarchical attachment). Default is currently (‘s22’, ‘ld’).
tries (int, optional) – The number of times to run the algorithm.
threads (int, optional) – The number of threads to use (using multiprocessing).
returntype ('TileSet' or 'equiv' (default 'equiv')) – The type of object to return. If ‘equiv’, returns an array of glue equivalences (or list, if best != 1) that can be applied to the tileset with apply_equiv, or used for further reduction. If ‘TileSet’, return a TileSet with the equiv already applied (or a list, if best != 1).
best (int or None, optional) – The number of systems to return. If 1, the result will be returned directly; if k > 1, a list will be returned of the best k results (per cmp); if k = None, a list of all results will be returned, sorted by cmp. (default 1)
key (function (ts, equiv1, equiv2) -> some number/comparable) – A comparison function for equivs, to sort the results. FIXME: documentation needed. Default (if None) here is to sort by number of glues in the system, regardless of number of tiles.
initequiv (equiv) – If provided, the equivalence array to start from. If None, start from the tileset without any merged glues.
- Returns:
reduced – The reduced system/systems
- Return type:
single TileSet