interferometer 1.1.1__tar.gz → 1.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: interferometer
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Algorithms for universal interferometers
5
5
  Author-email: "William R. Clements" <mail@william-clements.com>
6
6
  Project-URL: Homepage, https://github.com/clementsw/interferometer
@@ -15,6 +15,7 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: numpy
17
17
  Requires-Dist: matplotlib
18
+ Dynamic: license-file
18
19
 
19
20
  # Interferometer package
20
21
 
@@ -84,10 +84,10 @@ class Interferometer:
84
84
  complex-valued 2D numpy array representing the interferometer
85
85
  """
86
86
  N = int(self.count_modes())
87
- U = np.eye(N, dtype=np.complex_)
87
+ U = np.eye(N, dtype=np.complex128)
88
88
 
89
89
  for BS in self.BS_list:
90
- T = np.eye(N, dtype=np.complex_)
90
+ T = np.eye(N, dtype=np.complex128)
91
91
  T[BS.mode1 - 1, BS.mode1 - 1] = np.exp(1j * BS.phi) * np.cos(BS.theta)
92
92
  T[BS.mode1 - 1, BS.mode2 - 1] = -np.sin(BS.theta)
93
93
  T[BS.mode2 - 1, BS.mode1 - 1] = np.exp(1j * BS.phi) * np.sin(BS.theta)
@@ -187,7 +187,7 @@ def triangle_decomposition(U):
187
187
  modes = [N - jj - 1, N - jj]
188
188
  theta = custom_arctan(U[ii, N - 1 - jj], U[ii, N - 2 - jj])
189
189
  phi = -custom_angle(-U[ii, N - 1 - jj], U[ii, N - 2 - jj])
190
- invT = np.eye(N, dtype=np.complex_)
190
+ invT = np.eye(N, dtype=np.complex128)
191
191
  invT[modes[0]-1, modes[0]-1] = np.exp(-1j * phi) * np.cos(theta)
192
192
  invT[modes[0]-1, modes[1]-1] = np.exp(-1j * phi) * np.sin(theta)
193
193
  invT[modes[1]-1, modes[0]-1] = -np.sin(theta)
@@ -218,7 +218,7 @@ def square_decomposition(U):
218
218
  modes = [ii - jj + 1, ii + 2 - jj]
219
219
  theta = custom_arctan(U[N-1-jj, ii-jj], U[N-1-jj, ii-jj+1])
220
220
  phi = custom_angle(U[N-1-jj, ii-jj], U[N-1-jj, ii-jj+1])
221
- invT = np.eye(N, dtype=np.complex_)
221
+ invT = np.eye(N, dtype=np.complex128)
222
222
  invT[modes[0]-1, modes[0]-1] = np.exp(-1j * phi) * np.cos(theta)
223
223
  invT[modes[0]-1, modes[1]-1] = np.exp(-1j * phi) * np.sin(theta)
224
224
  invT[modes[1]-1, modes[0]-1] = -np.sin(theta)
@@ -230,7 +230,7 @@ def square_decomposition(U):
230
230
  modes = [N+jj-ii-1, N+jj-ii]
231
231
  theta = custom_arctan(U[N+jj-ii-1, jj], U[N+jj-ii-2, jj])
232
232
  phi = custom_angle(-U[N+jj-ii-1, jj], U[N+jj-ii-2, jj])
233
- T = np.eye(N, dtype=np.complex_)
233
+ T = np.eye(N, dtype=np.complex128)
234
234
  T[modes[0]-1, modes[0]-1] = np.exp(1j * phi) * np.cos(theta)
235
235
  T[modes[0]-1, modes[1]-1] = -np.sin(theta)
236
236
  T[modes[1]-1, modes[0]-1] = np.exp(1j * phi) * np.sin(theta)
@@ -240,7 +240,7 @@ def square_decomposition(U):
240
240
 
241
241
  for BS in np.flip(left_T, 0):
242
242
  modes = [int(BS.mode1), int(BS.mode2)]
243
- invT = np.eye(N, dtype=np.complex_)
243
+ invT = np.eye(N, dtype=np.complex128)
244
244
  invT[modes[0]-1, modes[0]-1] = np.exp(-1j * BS.phi) * np.cos(BS.theta)
245
245
  invT[modes[0]-1, modes[1]-1] = np.exp(-1j * BS.phi) * np.sin(BS.theta)
246
246
  invT[modes[1]-1, modes[0]-1] = -np.sin(BS.theta)
@@ -271,7 +271,7 @@ def random_unitary(N):
271
271
  Returns:
272
272
  complex-valued 2D numpy array representing the interferometer
273
273
  """
274
- X = np.zeros([N, N], dtype=np.complex_)
274
+ X = np.zeros([N, N], dtype=np.complex128)
275
275
  for ii in range(N):
276
276
  for jj in range(N):
277
277
  X[ii, jj] = (np.random.normal() + 1j * np.random.normal()) / np.sqrt(2)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: interferometer
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Algorithms for universal interferometers
5
5
  Author-email: "William R. Clements" <mail@william-clements.com>
6
6
  Project-URL: Homepage, https://github.com/clementsw/interferometer
@@ -15,6 +15,7 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: numpy
17
17
  Requires-Dist: matplotlib
18
+ Dynamic: license-file
18
19
 
19
20
  # Interferometer package
20
21
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "interferometer"
7
- version = "1.1.1"
7
+ version = "1.1.2"
8
8
  authors = [
9
9
  { name="William R. Clements", email="mail@william-clements.com" },
10
10
  ]
File without changes
File without changes
File without changes