Skip to content

Trap

Trap_beams

A class to represent a trap, wich is a bundle of beams and a propagation axis.

Attributes:

Name Type Description
beams

An array of Beams instances.

propagation_axis str

A string that represents the propagation axis of the trap.

Exceptions:

Type Description
ValueError

if no beam is provided

ValueError

if 3 Beams are provided, please put two of them in a Pair.

Todo

Add a way to put as many beams as wanted in a trap.

Examples:

To create a trap, first create the instances of Beams:

>>> BP = BeamPair(935e-9,"f",1*mW,935e-9,"f",1*mW)
>>> B = Beam(685e-9,"f",1*mW)
>>> trap = Trap(BP,B,propagation_axis="X")

directions property readonly

Get the directions of each beam in the trap

Returns:

Type Description
array

directions of each beam in the trap

lmbdas property readonly

Get the wavelengths of each beam in the trap

Returns:

Type Description
array

wavelengths of each beam in the trap (m)

powers property readonly

Get the powers of each beam in the trap

Returns:

Type Description
array

powers of each beam in the trap (W)

set_powers(self, powerlist)

Set the powers of each beam in the trap

Parameters:

Name Type Description Default
powerlist list

list of one power per Beam (W)

required

Exceptions:

Type Description
ValueError

too many powers provided

Caution

Only provide one power for a BeamPair.

Source code in nanotrappy\trapping\trap.py
def set_powers(self, powerlist):
    """Set the powers of each beam in the trap

    Args:
        powerlist (list): list of one power per Beam (W)

    Raises:
        ValueError: too many powers provided

    Caution:
        Only provide one power for a BeamPair.

    """
    if len(powerlist) == len(self.beams): 
        for beam in self.beams :
            beam.set_power(powerlist.pop(0))
    else :
        raise ValueError("You must give as many powers as there are beams")