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

Update Product manual #284

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions docs/src/manual/ansatz/product.md
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
# `Product` ansatz

```@setup examples
using Tenet
using Makie
Makie.inline!(true)
set_theme!(resolution=(800,400))
using GraphMakie
using CairoMakie
CairoMakie.activate!(type = "svg")
using NetworkLayout
```

A [`Product`](@ref) is the simplest [`Ansatz`](@ref) Tensor Network, which consists of a [`Tensor`](@ref) per [`Lane`](@ref) without any bonds, so all the sites are unconnected.
The [`Socket`](@ref) type of a [`Product`](@ref) (whether it represents a [`State`](@ref) or an [`Operator`](@ref)) depends on the order of the tensors provided in the constructor.

## `Product` State
Each tensor is one-dimensional, with the only index being the output physical index.

```@example examples
fig = Figure() # hide

qtn = Product([rand(2) for _ in 1:3])

graphplot!(fig[1,1], qtn, layout=Spring(iterations=1000, C=0.5, seed=100)) # hide
Label(fig[1,1, Bottom()], "Product State") # hide

fig # hide
```

## `Product` Operator
Each tensor is two-dimensional, with the indices being the input and output physical indices.

```@example examples
fig = Figure() # hide

qtn = Product([rand(2, 2) for _ in 1:3])

graphplot!(fig[1,1], qtn, layout=Spring(iterations=1000, C=0.5, seed=100)) # hide
Label(fig[1,1, Bottom()], "Product Operator") # hide

fig #hide
```
Loading