fix npy->numpy
This commit is contained in:
parent
6937bbf455
commit
711ce119d0
12
nom-eme.py
12
nom-eme.py
@ -268,10 +268,10 @@ def connect_s(
|
|||||||
denom = 1 - A[..., kk, kk] * B[..., ll, ll]
|
denom = 1 - A[..., kk, kk] * B[..., ll, ll]
|
||||||
Anew = A + A[..., kk, :] * B[..., ll, ll] * A[..., :, kk] / denom
|
Anew = A + A[..., kk, :] * B[..., ll, ll] * A[..., :, kk] / denom
|
||||||
Bnew = A[..., kk, :] * B[..., :, ll] / denom
|
Bnew = A[..., kk, :] * B[..., :, ll] / denom
|
||||||
Anew = npy.delete(Anew, (k,), 1)
|
Anew = numpy.delete(Anew, (k,), 1)
|
||||||
Anew = npy.delete(Anew, (k,), 2)
|
Anew = numpy.delete(Anew, (k,), 2)
|
||||||
Bnew = npy.delete(Bnew, (l,), 1)
|
Bnew = numpy.delete(Bnew, (l,), 1)
|
||||||
Bnew = npy.delete(Bnew, (l,), 2)
|
Bnew = numpy.delete(Bnew, (l,), 2)
|
||||||
|
|
||||||
dtype = (A[0, 0] * B[0, 0]).dtype
|
dtype = (A[0, 0] * B[0, 0]).dtype
|
||||||
C = numpy.zeros(tuple(A.shape[:-2]) + (nn, nn), dtype=dtype)
|
C = numpy.zeros(tuple(A.shape[:-2]) + (nn, nn), dtype=dtype)
|
||||||
@ -332,8 +332,8 @@ def innerconnect_s(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# remove connected ports
|
# remove connected ports
|
||||||
C = npy.delete(C, (k, l), 1)
|
C = numpy.delete(C, (k, l), 1)
|
||||||
C = npy.delete(C, (k, l), 2)
|
C = numpy.delete(C, (k, l), 2)
|
||||||
|
|
||||||
return C
|
return C
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user