Comments (4)
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.
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.
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.
Closed by #37.
from namedgraphs.jl.
Related Issues (20)
- Define `undirected_is_tree` and/or `undirected_underlying_graph`
- Introduce a PartitionedGraph Type HOT 2
- Introduce `cartesian_graph(...)`
- Disable `g[[1, 2, 3]]` for getting an induced subgraph
- Out-of-place `add_vertex`, `rem_vertex`, `add_edge`, `rem_edge` HOT 1
- Make `hexagonal_lattice_graph` more consistent between periodic and non-periodic HOT 4
- Don't reexport anything from `Graphs.jl` HOT 1
- Throw an error if `named_hexagonal_lattice_graph(n, m; periodic = true)` is called with `n` or `m` = 2
- Naming convention for `NamedGraph` graph generators HOT 1
- Move `KaHyPar` and `Metis` to package extensions HOT 1
- Make types of fields in `PartitionedGraph` more specific HOT 2
- `named_*(vertices)`
- Rename `vertextype` to `vertex_type` HOT 1
- Change the design of `GenericNamedGraph` type
- More `GraphsExtensions` tests
- Consider renaming `PartitionVertex` to `Partition`
- [BUG] Possible bug in `steiner_tree` HOT 2
- Add `pre_order_dfs_edges`
- More sophisticated lattice boundary conditions HOT 2
- Lattices to add
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from namedgraphs.jl.