Skip to content

Commit

Permalink
v0.3.5 ready
Browse files Browse the repository at this point in the history
  • Loading branch information
sachamedaer committed Jul 9, 2020
1 parent b9fd908 commit c1fd1d4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ make clean && make html
* 0.3.2 : New components + multi-processing for Taylor series
* 0.3.3 : New components + new parameters + 3D plot refactoring
* 0.3.4 : Optical filter update
* 0.3.5 : Noise management in ideal components

## Hosting

Expand Down
Binary file modified optcom/components/__pycache__/fiber_coupler.cpython-37.pyc
Binary file not shown.
Binary file modified optcom/components/__pycache__/ideal_amplifier.cpython-37.pyc
Binary file not shown.
Binary file modified optcom/components/__pycache__/port.cpython-37.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions optcom/components/ideal_amplifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,16 @@ def __call__(self, domain: Domain, ports: List[int], fields: List[Field]
for i in range(len(domain.time)):
if (callable(self.gain)):
gain_ = self.gain(domain.time[i])
# Temp hardcoding
gain_noise = 0.0
else:
gain_ = self.gain
# Temp hardcoding
gain_noise = 10**(0.1*self.gain)
gain[i] = cmath.sqrt(10**(0.1*gain_)) # dB -> m^{-1}
for i in range(len(fields)):
output_fields.append(fields[i] * gain)
output_fields[-1].noise *= gain_noise

return self.output_ports(ports), output_fields

Expand Down

0 comments on commit c1fd1d4

Please sign in to comment.