From 12d2380de3f765346bea3dabe2c26471adef1b15 Mon Sep 17 00:00:00 2001 From: Lou Bernabeu <lou.bernabeu@student-cs.fr> Date: Sat, 2 Jan 2021 18:12:05 +0100 Subject: [PATCH] Removed trailing spaces --- definition.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/definition.py b/definition.py index 13af14a..4958740 100644 --- a/definition.py +++ b/definition.py @@ -28,24 +28,24 @@ class Photon: print(self.state0[-1], "|0> + ", self.state1[-1], "|1>") def round_state(self,decimal,i): - s_0r = round((self.state0[i]).real,decimal) + s_0r = round((self.state0[i]).real,decimal) s_0i = round((self.state0[i]).imag,decimal) s_1r = round((self.state1[i]).real,decimal) - s_1i = round((self.state1[i]).imag,decimal) + s_1i = round((self.state1[i]).imag,decimal) return(s_0r, s_0i, s_1r, s_1i) def is_2D(self,i): - s_0r = round((self.state0[i]).real,3) + s_0r = round((self.state0[i]).real,3) s_0i = round((self.state0[i]).imag,3) s_1r = round((self.state1[i]).real,3) - s_1i = round((self.state1[i]).imag,3) + s_1i = round((self.state1[i]).imag,3) return (s_0r*s_0i == 0 and s_1r*s_1i == 0 and s_0r*s_1i == 0 and s_1r*s_0i == 0) def pur(self,i): rho0, phi0 = polar(self.state0[i]) rho1, phi1 = polar(self.state1[i]) return (2*acos(rho0), phi1-phi0) - + def gate(self,plate): alpha = self.state0[-1] beta = self.state1[-1] @@ -64,7 +64,7 @@ class Photon: self.state1.append(1/2*(beta + 1j*alpha)) def representation(self,i): - + #Bloch Sphere fig = plt.figure() -- GitLab