Ejemplo n.º 1
0
    def layout(nbr_channels_seed, peak_powers_seed, center_lambdas_seed,
               nbr_channels_pump, peak_powers_pump, center_lambdas_pump,
               REFL_SEED, REFL_PUMP, NOISE):
        nbr_ch_seed = nbr_channels_seed // 2
        gssn = Gaussian(channels=nbr_ch_seed,
                        peak_power=peak_powers_seed[:nbr_ch_seed],
                        center_lambda=center_lambdas_seed[:nbr_ch_seed])
        gssn_ = Gaussian(channels=(nbr_channels_seed - nbr_ch_seed),
                         peak_power=peak_powers_seed[nbr_ch_seed:],
                         center_lambda=center_lambdas_seed[nbr_ch_seed:])
        nbr_ch_pump = nbr_channels_pump // 2
        pump = CW(channels=nbr_ch_pump,
                  peak_power=peak_powers_pump[:nbr_ch_pump],
                  center_lambda=center_lambdas_pump[:nbr_ch_pump])
        pump_ = CW(channels=(nbr_channels_pump - nbr_ch_pump),
                   peak_power=peak_powers_pump[nbr_ch_pump:],
                   center_lambda=center_lambdas_pump[nbr_ch_pump:])
        fiber = FiberYb(length=0.01,
                        steps=10,
                        REFL_SEED=REFL_SEED,
                        REFL_PUMP=REFL_PUMP,
                        BISEED=True,
                        BIPUMP=True,
                        save_all=True,
                        alpha=[0.05],
                        max_nbr_iter=2,
                        NOISE=NOISE)
        lt = Layout(Domain(samples_per_bit=64, noise_samples=10))
        lt.add_unidir_links((gssn[0], fiber[0]), (pump[0], fiber[2]),
                            (gssn_[0], fiber[1]), (pump_[0], fiber[3]))
        lt.run_all()

        return fiber.storages[0]
Ejemplo n.º 2
0
    def layout(split_noise_option, channels, peak_powers, center_lambdas):
        gssn = Gaussian(channels=channels,
                        peak_power=peak_powers,
                        center_lambda=center_lambdas,
                        save=True)
        pump = CW(channels=3, peak_power=[0.01], center_lambda=[976.])
        fiber = FiberYb(length=0.01,
                        split_noise_option=split_noise_option,
                        steps=10,
                        REFL_SEED=True,
                        REFL_PUMP=True,
                        BISEED=False,
                        BIPUMP=False,
                        save=True,
                        PROP_REFL=True,
                        PROP_PUMP=True,
                        alpha=[0.05],
                        max_nbr_iter=2,
                        NOISE=True)
        lt = Layout(Domain(samples_per_bit=64, noise_samples=10))
        lt.add_unidir_links((gssn[0], fiber[0]), (pump[0], fiber[2]))
        lt.run_all()

        noise_power_input = fiber[0].fields[0].noise
        noise_power_seed = fiber[1].fields[0].noise
        noise_power_refl_seed = fiber[0].fields[1].noise
        noise_power_pump = fiber[1].fields[1].noise
        noise_power_refl_pump = fiber[0].fields[2].noise

        return (noise_power_input, noise_power_seed, noise_power_refl_seed,
                noise_power_pump, noise_power_refl_pump)
Ejemplo n.º 3
0
def test_non_existant_link_del():
    """Should raise error if trying to delete a non-existing link."""
    # Environment creation
    a = IdealCoupler(name='a')
    b = IdealCoupler(name='b')
    c = IdealCoupler(name='c')
    layout = Layout()
    layout.add_links((a[1], b[0]), (a[2], b[1]))
    layout.add_unidir_links((b[2], c[2]), (a[0], c[1]))
    layout.del_link(c[2], b[2])  # Valid (even if unidir in other dir.)
    # Testing
    pytest.raises(DelError, layout.del_links, (c[2], b[2]))
    pytest.raises(DelError, layout.del_links, (a[1], b[1]))
    pytest.raises(DelError, layout.del_links, (a[2], c[2]))
Ejemplo n.º 4
0
    def layout(nbr_channels_seed, peak_powers_seed, center_lambdas_seed,
               nbr_channels_pump, peak_powers_pump, center_lambdas_pump,
               REFL_SEED, REFL_PUMP, NOISE):
        gssn = Gaussian(channels=nbr_channels_seed,
                        peak_power=peak_powers_seed,
                        center_lambda=center_lambdas_seed)
        pump = CW(channels=nbr_channels_pump,
                  peak_power=peak_powers_pump,
                  center_lambda=center_lambdas_pump)
        fiber = FiberYb(length=0.01,
                        steps=10,
                        REFL_SEED=REFL_SEED,
                        REFL_PUMP=REFL_PUMP,
                        BISEED=False,
                        BIPUMP=False,
                        save_all=True,
                        alpha=[0.05],
                        max_nbr_iter=2,
                        NOISE=NOISE)
        lt = Layout(Domain(samples_per_bit=64, noise_samples=10))
        lt.add_unidir_links((gssn[0], fiber[0]), (pump[0], fiber[2]))
        lt.run_all()

        return fiber.storages[0]