Giter VIP home page Giter VIP logo

combinatorialchains.jl's People

Contributors

aj-searle avatar atomyka avatar epatters avatar ggeneraux avatar jpfairbanks avatar olynch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

stjordanis

combinatorialchains.jl's Issues

function

J₀ = @acset IsingModel begin
    V1 = 9
    L1 = 12
    src1 = [1,2,5,5,5,5,7,8,3,6,1,4]
    tgt1 = [2,3,2,4,6,8,8,9,6,9,4,7]
  end

  m = homomorphisms(codom(rule(4)[1]), J₀, monic=true)[1]
  J₁ = rewrite_match(rule(4)..., m)
  to_graphviz(J₁)




  function rewrite_ising(j::IsingCats.AbstractIsingModel, T, maxtries=100)
    # choose a random rule
    for i in 1:maxtries
      l,r = rule(rand(0:4))
    if rand(Bool)
        r,l = l,r
    end
  
  #      l,r = rule(4)

      qₗ = homomorphism_query(codom(l))
      matches = query(j, qₗ)
      @show length(matches)

      αs = map(ρ -> make_homomorphism(matches[ρ], codom(l), j),
         1:length(matches))


      # quick hack for "monic on V1"
      αs = filter(αs) do α
        length(unique(collect(components(α).V1))) == length(collect(components(α).V1))
      end

      @show length(αs)
      for α in αs
        println(components(α).V1)
      end

      αs = filter(α->valid_dpo(l, α), αs)
      @show length(αs)

      if length(αs) > 0

        for i in 1:maxtries
          # compute table of matches
          # pick random match
          @show ρ = rand(1:length(αs))
          α = αs[ρ]
          @show components(α)
          @show valid_dpo(l, α)
          @show accept_rewrite(Span(l, r), T)

          if valid_dpo(l, α) && accept_rewrite(Span(l, r), T)
            α₂ = rewrite_match(l, r, α)
            return α₂
          end
        end
      end
  end 
     error("Could not find a valid match in $maxtries attempts")
end

 K = rewrite_ising(J₀, 2, 80)
 to_graphviz(K)

Make Rules Symmetric

One of the problems with our current implementation is that the rule are oriented but the underlying phenomenon isn't oriented this means that after you match a rule you might not be able to match other rules, because of the changes to the orientation. We should be using the SymmetricIsingModel schema, but before we do that, we can just make the systems and rules symmetric by adding in all the reciprocal edges.

Plots for Presentation

In order to present results, we should probably:

  1. run a simulation for 1K steps (number chosen by gut feeling)
  2. plot the initial state and final state
  3. track the average energy of the system for all of our samples
  4. repeat this process for several values of temperature

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.