Skip to content

Releases: maxitg/SetReplace

MaxDestroyerEvents aka Partial Multihistories

17 Mar 20:48
daaa3c7
Compare
Choose a tag to compare

This release introduces "MaxDestroyerEvents" stopping condition to WolframModel. It allows one to generate partial multihistories (local multiway systems), which are intermediate between "GlobalMultiway" and "MultiwaySpacelike" event selection functions:

In[] := WolframModel[
    {{1, 2}, {2, 3}} -> {{1, 3}},
    Partition[Range[10], 2, 1],
    <|"MaxDestroyerEvents" -> 2|>,
    "EventSelectionFunction" -> "MultiwaySpacelike"][
  "ExpressionsEventsGraph", VertexLabels -> Automatic]

image

Kudos to @daneelsan for implementing this feature!

CausalDensityDimension

26 Feb 17:20
0136141
Compare
Choose a tag to compare

This release introduces CausalDensityDimension which allows one to estimate Myrheim-Meyer dimension of causal graphs:

Needs["GeneralUtilities`"];
dimensionsPlot[rule_, init_, generationCount_, eventOrderingFunction_, sampleSize_] := ModuleScope[
  history = WolframModel[rule, init, generationCount, "EventOrderingFunction" -> eventOrderingFunction];
  eventRangesForGenerations = # + {1, 0} & /@ Partition[Accumulate @ history["GenerationEventsCountList"], 2, 1];
  causalGraph = history["CausalGraph"];
  dimensionsForGenerations = Join[
    {Missing[]},
    MeanAround /@
      ParallelMap[CausalDensityDimension[causalGraph, {1, #}] &,
          RandomSample[#, UpTo[sampleSize]] & /@ Range @@@ eventRangesForGenerations,
          {2}]];
  ListPlot[dimensionsForGenerations, PlotRange -> All, Frame -> True, FrameLabel -> {"Generations", "Dimension"}]
];
In[] := dimensionsPlot[
  {{1, 2, 3}, {4, 3, 5}} -> {{6, 3, 7}, {6, 1, 2}, {3, 4, 1}}, {{1, 1, 1}, {1, 1, 1}}, 60, Automatic, 30]

image

In other news:

  • "FeatureAssociation" property allows one to extract an association with named features (more work still needs to be done on the features themselves).
  • More functions now support syntax autocompletion.
  • We improved the usage messages and function templates to use more descriptive argument names.
  • WolframPhysicsProjectStyleData is now renamed to SetReplaceStyleData. The old name still works for backwards compatibility.

Thanks to @SantiagoGiner, @mrektor, and @daneelsan for contributing to this release!

AcyclicGraphTake and Consistency Improvements

25 Jan 17:53
d829db6
Compare
Choose a tag to compare

This release introduces:

  • AcyclicGraphTake function that allows one to easily take "causal diamonds" between two vertices of a DAG:
In[] := With[{
    graph = WolframModel[
        {{{1, 2}, {1, 3}, {1, 4}} -> {{2, 2}, {2, 5}, {3, 2}, {3, 4}, {4, 5}}}, {{1, 1}, {1, 1}, {1, 1}}, 15][
      "CausalGraph", VertexStyle -> LightGray, EdgeStyle -> Gray]},
  HighlightGraph[graph, AcyclicGraphTake[graph, {4, 268}]]
]

Thanks to @SantiagoGiner, @daneelsan and @aokellermann for contributing to this release!

Internal Improvements

28 Dec 22:56
ec58541
Compare
Choose a tag to compare

In this release, we focused on the improvements to the development process, testing, and refactoring.

Some notable changes are:

  • WolframModelPlot is now renamed back to HypergraphPlot. The old name still works for backward compatibility.
  • Stability improvements for the case where multiple versions of the paclet are installed simultaneously.
  • More consistent style in the usage messages.

If you are a developer, here are some of the improvements to the workflow:

  • A new build system that, among other things, allows you to rebuild libSetReplace automatically by simply running
Get[FileNameJoin[{$SetReplaceRoot, "Kernel", "init.m"}]]
  • Multi-platform paclets for all builds (that is, all commits on all branches) are now automatically created by Circle CI.
  • We extended the linter to format bash and Markdown code and check the line width. There are also now git hooks for automatically checking for linting issues before a push and automatically formatting before a commit.

We also started working on a feature extractor that would allow one to use machine learning functions with Wolfram models. The work on that is in the early stage of development.

Kudos to @mrektor, @taliesinb, @daneelsan, and @aokellermann for contributing to this release!

RandomHypergraph

09 Nov 17:45
d3e9126
Compare
Choose a tag to compare

We now have RandomHypergraph! You can either specify a signature or a single number to vary the arities randomly:

In[] := WolframModelPlot @ RandomHypergraph[1000]

image

Thanks to @daneelsan and @taliesinb for contributing to this release!

HypergraphToGraph & IsomorphicHypergraphQ

04 Nov 09:53
8114c05
Compare
Choose a tag to compare

This release introduces HypergraphToGraph. It can convert ordered hypergraphs to graphs in multiple ways, either preserving distances or in a lossless way:

In[] := Graph3D @ HypergraphToGraph[
  WolframModel[
    {{1, 2, 2}, {3, 4, 5}} -> {{5, 6, 6}, {7, 2, 5}, {8, 2, 6}, {2, 1, 3}}, Automatic, 50, "FinalState"],
  "StructurePreserving"]

image

Thanks to that lossless conversion, we now also have IsomorphicHypergraphQ.

Also, we added "MultiwayQ" property, which can tell you if a given evolution contains any multiway branching.

Kudos to @wawo9193, @daneelsan, and @taliesinb for contributing to this release!

IndexHypergraph

20 Oct 02:04
e78a32c
Compare
Choose a tag to compare

In addition to improvements to stability and performance, we have introduced the IndexHypergraph function:

In[] := IndexHypergraph[{{a, b, c}, {b, d, e}, {c, f, g}}]
Out[] = {{1, 2, 3}, {2, 4, 5}, {3, 6, 7}}

Also, you can now pass evolution objects directly to RulePlot:

image

Thanks to @daneelsan and @aokellermann for contributing to this release!

Subhypergraph & Performance Improvements

12 Oct 21:55
e3192ed
Compare
Choose a tag to compare

In this release, we focused on stability, performance, and streamlining SetReplace for our users and developers:

  • We introduced Subhypergraph and WeakSubhypergraph functions.

    In[] := With[{
        evolution = WolframModel[{{1, 2}, {2, 3}} -> {{4, 2}, {4, 1}, {2, 1}, {3, 4}}, Automatic, Automatic]},
      evolution["FinalStatePlot",
                EdgeStyle -> LightGray,
                GraphHighlight -> WeakSubhypergraph[evolution["FinalState"], Range[9, 16]]]]
    image
  • We have a new event ordering function called "Any", which generates an undefined evolution order. There is not much use for it yet, but it paves the road for some powerful optimizations in the future.

  • You can now use VertexLabels -> "Index" in "ExpressionsEventsGraph" that displays the indices of events and expressions in a much more compact way than VertexLabels -> "Name".

We also did some weed whacking:

  • ./build.wls script should no longer fail if the repository is located under a symbolic link.

  • Vertex names which are themselves lists now work correctly in WolframModel.

Huge thanks to @aokellermann and @daneelsan for contributing to this release!

Support for Wolfram Language 12.2

07 Oct 02:57
b82c93e
Compare
Choose a tag to compare

SetReplace is now fully compatible with Wolfram Language version 12.2.

If you were running 12.2 and were having issues with WolframModelPlot, these are now resolved.

Event Deduplication

28 Sep 19:26
6f11676
Compare
Choose a tag to compare

This release introduces event deduplication. If two events have the same set of inputs and the outputs identical up to the renaming of new atoms, they can now be deduplicated using "EventDeduplication" -> "SameInputSetIsomorphicOutputs".

In[] := WolframModel[{{1, 2}, {1, 3}} -> {{1, 2}, {1, 4}, {2, 4}, {3, 
     4}}, {{1, 1}, {1, 1}}, 3, 
  "EventSelectionFunction" -> "MultiwaySpacelike", 
  "EventDeduplication" -> 
   "SameInputSetIsomorphicOutputs"]["ExpressionsEventsGraph", 
 GraphLayout -> "SpringElectricalEmbedding"]

image

Also, the weed where the output graph's size would reset after each re-evaluation is now fixed.