Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor interface #16

Merged
merged 3 commits into from
Oct 20, 2021
Merged

Refactor interface #16

merged 3 commits into from
Oct 20, 2021

Conversation

GiggleLiu
Copy link
Member

The new interface looks like:

julia> using OMEinsum, OMEinsumContractionOrders, LightGraphs, KaHyPar

julia> function random_regular_eincode(n, k; optimize=nothing)
	    g = LightGraphs.random_regular_graph(n, k)
	    ixs = [minmax(e.src,e.dst) for e in LightGraphs.edges(g)]
	    return EinCode((ixs..., [(i,) for i in     LightGraphs.vertices(g)]...), ())
    end
    
julia> code = random_regular_eincode(200, 3);

julia> optcode_tree = optimize_code(code, uniformsize(code, 2), TreeSA(sc_target=28, βs=0.1:0.1:10, ntrials=2, niters=100, sc_weight=3.0));

julia> optcode_kahypar = optimize_code(code, uniformsize(code, 2), KaHyParBipartite(sc_target=30, max_group_size=50));

julia> optcode_sa = optimize_code(code, uniformsize(code, 2), SABipartite(sc_target=30, max_group_size=50));

julia> OMEinsum.timespace_complexity(code, uniformsize(code, 2))
(200.0, 0.0)

julia> OMEinsum.timespace_complexity(optcode_kahypar, uniformsize(code, 2))
(38.0290167456887, 26.0)

julia> OMEinsum.timespace_complexity(optcode_sa, uniformsize(code, 2))
(34.86528023060411, 27.0)

julia> tc, sc = OMEinsum.timespace_complexity(optcode_tree, uniformsize(code, 2))
(30.541894421918297, 26.0)

@codecov
Copy link

codecov bot commented Oct 20, 2021

Codecov Report

Merging #16 (426e129) into master (1049e6a) will decrease coverage by 0.50%.
The diff coverage is 90.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #16      +/-   ##
==========================================
- Coverage   95.13%   94.62%   -0.51%     
==========================================
  Files           5        6       +1     
  Lines         493      540      +47     
==========================================
+ Hits          469      511      +42     
- Misses         24       29       +5     
Impacted Files Coverage Δ
src/treesa.jl 94.20% <66.66%> (+0.02%) ⬆️
src/interfaces.jl 87.50% <87.50%> (ø)
src/simplify.jl 94.64% <91.17%> (-5.36%) ⬇️
src/OMEinsumContractionOrders.jl 100.00% <100.00%> (ø)
src/kahypar.jl 93.52% <100.00%> (-0.05%) ⬇️
src/sa.jl 97.45% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1049e6a...426e129. Read the comment docs.

@GiggleLiu GiggleLiu merged commit ac6f625 into master Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant