-
Notifications
You must be signed in to change notification settings - Fork 55
/
basereps_cython.pxd
67 lines (52 loc) · 2.14 KB
/
basereps_cython.pxd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
"""
Base classes for Cython representations.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights
# in this software.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0 or in the LICENSE file in the root pyGSTi directory.
#***************************************************************************************************
from libcpp cimport bool
from libcpp.vector cimport vector
from libcpp.pair cimport pair
from libcpp.algorithm cimport sort as stdsort
from libcpp.unordered_map cimport unordered_map
cimport numpy as _np
cimport cython
#Use 64-bit integers
ctypedef long long INT
ctypedef unsigned long long UINT
cdef class OpRep:
pass
cdef class StateRep:
pass
cdef class EffectRep:
pass
cdef class TermRep:
pass
cdef extern from "basecreps.h" namespace "CReps":
cdef cppclass PolynomialVarsIndex:
PolynomialVarsIndex() except +
PolynomialVarsIndex(INT) except +
bool operator<(PolynomialVarsIndex i)
vector[INT] _parts
cdef cppclass PolynomialCRep:
PolynomialCRep() except +
PolynomialCRep(unordered_map[PolynomialVarsIndex, complex], INT, INT) except +
PolynomialCRep abs()
PolynomialCRep mult(PolynomialCRep&)
PolynomialCRep abs_mult(PolynomialCRep&)
void add_inplace(PolynomialCRep&)
void add_abs_inplace(PolynomialCRep&)
void add_scalar_to_all_coeffs_inplace(double complex offset)
void scale(double complex scale)
vector[INT] int_to_vinds(PolynomialVarsIndex indx_tup)
unordered_map[PolynomialVarsIndex, complex] _coeffs
INT _max_num_vars
INT _vindices_per_int
cdef class PolynomialRep:
cdef PolynomialCRep* c_polynomial
cdef PolynomialRep_from_allocd_PolynomialCRep(PolynomialCRep* crep)