Giter Site home page Giter Site logo

Comments (4)

JoeyT1994 avatar JoeyT1994 commented on July 28, 2024 1

I just realised that with this we would create the 127-qubit IBM heavy hex lattice as follows:

g_hex = hexagonal_lattice_graph(3, 5)
g_heavy_hex = decorate_graph(g_hex; edge_decoration=e -> named_grid((1)))
#Line of code that adds two additional qubits to the top right and top left of the lattice

hexagonal_lattice_graph(m::Int64, n::Int64) is a function I added in PR #35 that creates an m by n lattice of hexagons.
Inserting an extra vertex on each edge creates the heavy hex geometry (with loops of size 12).

Super neat when code comes together like that.

from namedgraphs.jl.

mtfishman avatar mtfishman commented on July 28, 2024

We could have a naming convention like (e, v) where e is the edge where the edge decoration graph is being inserted and v is the name of the vertex of the edge decoration graph. Or it is just up to the user to specify names based on the edge input, for example:

g = named_grid((L,L))
function edge_decoration_graph(e)
  g_e = named_graph()
  add_vertex!(g_e, src(e))
  add_vertex!(g_e, (e, 1))
  add_vertex!(g_e, dst(e))
  add_edge!(g_e, src(e), (e, 1))
  add_edge!(g_e, (e, 1), dst(e))
  return g_e
end
g_dec = decorate_graph(g::NamedGraph; edge_decoration=edge_decoration_graph)

but the convention of automatically adding an edge from src(e) to the first vertex and an edge from the last vertex to dst(e) could make sense, obviously that makes defining the edge decoration graphs simpler.

Also a complementary functionality would be to replace the vertices of a graph with a vertex decoration graph, for example:

function vertex_decoration_graph(v)
  g_v = named_graph()
  # ...
end
g_dec = decorate_graph(g::NamedGraph; vertex_decoration=vertex_decoration_graph)

from namedgraphs.jl.

JoeyT1994 avatar JoeyT1994 commented on July 28, 2024

I think that naming convention makes the most sense and we should have that as default. Also having vertex replacement makes sense too

from namedgraphs.jl.

mtfishman avatar mtfishman commented on July 28, 2024

Closed by #37.

from namedgraphs.jl.

Related Issues (20)

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.