Skip to content

Latest commit

 

History

History
3987 lines (2819 loc) · 106 KB

QTensor.rst

File metadata and controls

3987 lines (2819 loc) · 106 KB

QTensor Module

VQNet quantum machine learning uses the data structure QTensor which is Python interface. QTensor supports common multidimensional matrix operations including creating functions, mathematical functions, logical functions, matrix transformations, etc.

QTensor's Functions and Attributes


ndim

shape

size

numel

dtype

is_dense

is_csr

csr_members

zero_grad

backward

to_numpy

item

argmax

argmin

fill_

all

any

fill_rand_binary_

fill_rand_signed_uniform_

fill_rand_uniform_

fill_rand_normal_

QTensor.transpose

transpose_

QTensor.reshape

reshape_

getdata



GPU

CPU

toGPU

toCPU

isGPU

isCPU

Create Functions

ones

ones_like

full

full_like

zeros

zeros_like

arange

linspace

logspace

eye

diag

randu

randn

multinomial

triu

tril

Math Functions

floor

ceil

round

sort

argsort

topK

argtopK

add

sub

mul

divide

sums

cumsum

mean

median

std

var

matmul

kron

reciprocal

sign

neg

trace

exp

acos

asin

atan

sin

cos

tan

tanh

sinh

cosh

power

abs

log

log_softmax

sqrt

square

frobenius_norm

Logic Functions

maximum

minimum

min

max

clip

where

nonzero

isfinite

isinf

isnan

isneginf

isposinf

logical_and

logical_or

logical_not

logical_xor

greater

greater_equal

less

less_equal

equal

not_equal

Matrix Operations

select

broadcast

concatenate

stack

permute

transpose

tile

squeeze

unsqueeze

swapaxis

masked_fill

flatten

reshape

flip

gather

scatter

broadcast_to

dense_to_csr

csr_to_dense

Utility Functions

to_tensor

pad_sequence

pad_packed_sequence

pack_pad_sequence