local_operator
¶
Local operators on chosen sites.
LocalOperator
¶
Bases: Operator
Represent an operator that acts non-trivially on given sites.
The operator acts on the given sites of a tensor-product space.
sites[i] is tensor factor i of matrix, and factor 0 is the most
significant factor, in the same order as tensor. Site order names the
factors, so [0, 1] and [1, 0] are different operators. Sites may
skip indexes; embedding puts identity on every skipped site.
Source code in shadowsim/core/local_operator.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
__init__
¶
Initialize a LocalOperator acting non-trivially on the given sites.
Parameter matrix: The matrix representation of the operator. Precondition: matrix is a numpy array.
The sites on which the operator acts non-trivially, in
tensor-factor order. sites[0] is the first factor of matrix.
Precondition: sites is a non-empty list of distinct integers.
Parameter local_dim: The local dimension of the operator. Precondition: local_dim is a positive integer.
Source code in shadowsim/core/local_operator.py
get_sites
¶
get_local_dim
¶
get_matrix
¶
to_full_operator
¶
to_full_operator(total_sites: int) -> Operator
Embed this local operator into a full system of total_sites.
The operator acts on self.sites and identity acts on every other
site, including sites that sit in a gap. sites[0] is the first
tensor factor of the stored matrix. A site list that is not in
increasing order is permuted into that order before the identities are
inserted.
Parameter total_sites: The total number of sites in the full system. Precondition: total_sites is a positive integer.