julia-logo

一种科学计算的新尝试

Available at rogerluo.me

Benchmark

Tensor Contraction

Python (3.5 on IPython 6.3.1) 326 ms (C implementation in numpy)

import numpy as np

def propagate(LHS, X, Y):
    P = np.einsum('ijk, ipq', LHS, X)
    Q = np.einsum('jkqp, jvrq', P, Y)
    R = np.einsum('kprv, kvm', Q, X)
    return R
LHS = np.random.randn(200, 10, 200)
X = np.random.randn(200, 2, 200)
Y = np.random.randn(10, 2, 10, 2)

%timeit propagate(LHS, X, Y)

Python (3.5 on IPython 6.3.1) 45.1 ms (numpy.tensordot in numpy)

def propagate(LHS, X, Y):
    P = np.tensordot(LHS, X, axes=([0, ], [0, ]))
    Q = np.tensordot(P, Y, axes=([0, 2], [0, 1]))
    R = np.tensordot(Q, X, axes=([0, 3], [0, 1]))
    return R
LHS = np.random.randn(200, 10, 200)
X = np.random.randn(200, 2, 200)
Y = np.random.randn(10, 2, 10, 2)

%timeit propagate(LHS, X, Y)

Julia (0.6 with OpenBLAS) 24.593 ms (pure Julia implementation)

using TensorOperations
using BenchmarkTools

function propagate(LHS, X, Y)
    @tensor R[6,7,8] := LHS[1,2,3]*X[1,4,6]*Y[2,5,7,4]*X[3,5,8]
end

BLAS.set_num_threads(1)
LHS = randn(200, 10, 200); X = randn(200, 2, 200); Y = randn(10, 2, 10, 2);

@benchmark propagate(LHS, X, Y)
Plot 9

From IBM community: link

A Comparison of C Julia Numba and Cython on LU Factorization

numba

cython

numpy

scipy

julia

julia-cython

Comparition to QuTIP

benchmark

A Comparision between Differential Equation Solvers

compare

Why use Julia wrapper?

Why use the Julia Tensorflow

Some Selected Features

  • Multiple Dispatch
  • Dynamic Type System
  • Good Performance, approaching statically-compiled languages like C
  • Lisp-like macros and other metaprogramming facilities
  • Call Python functions: use the PyCall package
  • Call C functions directly: no wrappers or special APIs
  • Designed for parallelism and distributed computation
  • Automatic generation of efficient, specialized code for different argument types
  • elegant and extensible conversions and promotions for numeric and other types
  • Efficient support for Unicode, including but not limited to UTF-8
  • MIT licensed: free and open source

幺

Extensible Efficient Quantum Algorithm Design for Humans.

Quantum Computing is Approaching

Source: © By Thomas A. Campbell, Ph.D., FutureGrasp, LLC

roadmap

J. Ignacio Cirac & H. Jeff Kimble. "Quantum optics, what next?" Nature Photonics volume 11, pages 18–20 (2017).

Google IBM

Source: © By Nick Summers, engadget / Google AI lab

  • Quantum Circuit Born Machine
  • Quantum GAN
  • Quantum Circuit Compression

block tree

bench-xyz bench-rxyz

Julia中文社区:juliacn.com

谢谢