• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

cyclops-community/koala: A quantum system simulator using PEPS tensor network

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

cyclops-community/koala

开源软件地址:

https://github.com/cyclops-community/koala

开源编程语言:

Python 100.0%

开源软件介绍:

Koala

Koala is a quantum circuit/state simulator based on projected entangled–pair states (PEPS) tensor networks.

Installation

NumPy and TensorBackends are required. It is recommended to install Koala and TensorBackends in the editable (pip install -e) mode, as they are currently under development.

git clone https://github.com/cyclops-community/tensorbackends.git
pip install -e ./tensorbackends
git clone https://github.com/YiqingZhouKelly/koala.git
pip install -e ./koala

Parallelization is provided by Cyclops Tensor Framework, and is optional.

Testing

python -m unittest

Get Started

from koala import peps, Observable, Gate
from tensorbackends.interface import ImplicitRandomizedSVD

# initialize a 2 by 3 state with peps approach and numpy backend
qstate = peps.computational_zeros(2, 3, backend='numpy')

# we also provide the state vector approach and a parallel backend
# statevector.computational_zeros(2, 3, backend='ctf')

# apply one gate or a list of gates
qstate.apply_gate(Gate('X', [], [0])) # (name, parameters, qubits)
qstate.apply_circuit([
    Gate('R', [0.42], [2]),
    Gate('CX', [], [1,4])
], update_option=peps.LocalGramQRUpdate(rank=4))
# choose from a list of update algorithms and optionally specify the cap bond dimension for approximate state evolution

# or apply arbitrary single-site or two-site operators
# qstate.apply_operator(np.array(...), [0])

# compute the amplitude, probability, and expectation value
qstate.amplitude([1,0,0,1,0,0])
qstate.probability([1,0,0,1,0,0])
observable = 1.5 * Observable.sum([
    Observable.Z(0),
    Observable.XY(3, 4) * 2
])
qstate.expectation(observable, 
    contract_option=peps.BMPS(ImplicitRandomizedSVD(rank=8)), 
    use_cache=True
)
# choose from a list of contraction algorithms and optionally specify the cap bond dimension for approximate contraction
# use built-in caching option to trade memory for time in expectation value calculations



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap