Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
fix show
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed Oct 5, 2023
1 parent b0b6cc0 commit e01d6ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# YaoToEinsum

[![CI](https://github.com/QuantumBFS/YaoToEinsum.jl/workflows/CI/badge.svg)](https://github.com/QuantumBFS/YaoToEinsum.jl/actions)
[![codecov](https://codecov.io/gh/QuantumBFS/YaoToEinsum.jl/graph/badge.svg?token=ZwzRcQCksQ)](https://codecov.io/gh/QuantumBFS/YaoToEinsum.jl)

Convert Yao circuit to OMEinsum notation for tensor network based simulation.
Convert [Yao](https://github.com/QuantumBFS/Yao.jl) circuit to tensor networks (einsum).

## Installation

Expand All @@ -12,7 +13,7 @@ Convert Yao circuit to OMEinsum notation for tensor network based simulation.
pkg> add YaoToEinsum
```

## Example
## Using
This package contains one main function `yao2einsum(circuit; initial_state=Dict(), final_state=Dict(), optimizer=TreeSA())`.
It transform a [`Yao`](https://github.com/QuantumBFS/Yao.jl) circuit to a generalized tensor network (einsum notation). The return value is a `TensorNetwork` object.

Expand Down Expand Up @@ -54,6 +55,6 @@ julia> contract(network)[] ≈ Yao.zero_state(n)' * (Yao.zero_state(n) |> circui
true
```

## References

## Contribute and Cite
If you have any questions or suggestions, please feel free to open an issue or pull request.
If you use this package in your work, please cite the relevant part of the papers included in [CITATION.bib](CITATION.bib).
2 changes: 1 addition & 1 deletion src/Core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Base.show(io::IO, c::TensorNetwork)
print(io, contraction_complexity(c))
end
function Base.show(io::IO, ::MIME"text/plain", c::TensorNetwork)
print(io, c)
Base.show(io, c)
end
function Base.iterate(c::TensorNetwork, state=1)
if state > 2
Expand Down

0 comments on commit e01d6ff

Please sign in to comment.