Code Monkey home page Code Monkey logo

tencirchem's Introduction

TenCirChem

TenCirChem

ci codecov doc Binder

TenCirChem is an efficient and versatile quantum computation package for molecular properties. TenCirChem is based on TensorCircuit, with heavy optimization for chemistry applications.

Install

The package is written in pure Python and can be obtained via pip as:

pip install tencirchem

Getting Started

UCCSD calculation example

from tencirchem import UCCSD, M

d = 0.8
# distance unit is angstrom
h4 = M(atom=[["H", 0, 0, d * i] for i in range(4)])

# setup
uccsd = UCCSD(h4)
# calculate
uccsd.kernel()
# analyze result
uccsd.print_summary(include_circuit=True)

Running uccsd.kernel() in the above code determines the optimized circuit ansatz parameters and VQE energy.
It is equally straightforward for the user to supply their own custom parameters:

import numpy as np

from tencirchem import UCCSD
from tencirchem.molecule import h4

uccsd = UCCSD(h4)
# evaluate various properties based on custom parameters
params = np.zeros(uccsd.n_params)
print(uccsd.statevector(params))
print(uccsd.energy(params))
print(uccsd.energy_and_grad(params))

Please refer to the documentation for more examples and customization.

Features

  • Statics module
    • Extremely fast UCC calculation with UCCSD, kUpCCGSD, pUCCD
    • Noisy circuit simulation via TensorCircuit
    • Custom integrals, active space approximation, RDMs, GPU support, etc.
  • Dynamics module
    • Transformation from renormalizer models to qubit representation
    • VQA algorithm based on JAX
    • Built-in models: spin-boson model, pyrazine S1/S2 internal conversion dynamics

Design principle

  • Fast
    • UCC speed 10000x faster than other packages
      • Example: H8 with 16 qubits in 2s (CPU). H10 with 20 qubits in 14s (GPU)
      • Achieved by analytical expansion of UCC factors and exploitation of symmetry
  • Easy to hack
    • Avoid defining new classes and wrappers when possible
      • Example: Excitation operators are represented as tuple of int. An operator pool is simply a list of tuple
    • Minimal class inheritance hierarchy: at most two levels
    • Expose internal variables through class attributes

License

TenCirChem is released under Academic Public License. See the LICENSE file for details. In short, you can use TenCirChem freely for non-commercial/academic purpose and commercial use requires a commercial license.

tencirchem's People

Contributors

liwt31 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.