DimensionlessParticle

class plasmapy.particles.particle_class.DimensionlessParticle(*, mass: Optional[numbers.Real] = None, charge: Optional[numbers.Real] = None, symbol: Optional[str] = None)

Bases: plasmapy.particles.particle_class.AbstractParticle

A class to represent dimensionless custom particles.

This class may be used, for example, to represent a particle in a dimensionless particle-in-cell simulation.

Parameters
  • mass (positive real number, keyword-only, optional) – The mass of the dimensionless particle. Defaults to numpy.nan.

  • charge (real number, keyword-only, optional) – The electric charge of the dimensionless particle. Defaults to numpy.nan.

  • symbol (str, optional) – The symbol to be assigned to the dimensionless particle.

Notes

DimensionlessParticle instances are not considered ParticleLike because dimensionless particles cannot uniquely identify a physical particle without normalization information.

Examples

>>> from plasmapy.particles import DimensionlessParticle
>>> dimensionless_particle = DimensionlessParticle(mass=1.0, charge=-1.0, symbol="ξ")
>>> dimensionless_particle.mass
1.0
>>> dimensionless_particle.charge
-1.0
>>> dimensionless_particle.symbol
'ξ'

Attributes Summary

charge

The dimensionless charge of the particle.

json_dict

A json friendly dictionary representation of the particle.

mass

The dimensionless mass of the particle.

symbol

The symbol assigned to the dimensionless particle.

Attributes Documentation

charge

The dimensionless charge of the particle.

json_dict

A json friendly dictionary representation of the particle.

See AbstractParticle.json_dict for more details.

Examples

>>> from plasmapy.particles import DimensionlessParticle
>>> dimensionless_particle = DimensionlessParticle(mass=1.0, charge=-1.0)
>>> dimensionless_particle.json_dict
{'plasmapy_particle': {'type': 'DimensionlessParticle',
    'module': 'plasmapy.particles.particle_class',
    'date_created': '...',
    '__init__': {'args': (), 'kwargs': {'mass': 1.0, 'charge': -1.0,
    'symbol': 'DimensionlessParticle(mass=1.0, charge=-1.0)'}}}}
>>> dimensionless_particle = DimensionlessParticle(mass=1.0)
>>> dimensionless_particle.json_dict
{'plasmapy_particle': {'type': 'DimensionlessParticle',
    'module': 'plasmapy.particles.particle_class',
    'date_created': '...',
    '__init__': {'args': (), 'kwargs': {'mass': 1.0, 'charge': nan,
    'symbol': 'DimensionlessParticle(mass=1.0, charge=nan)'}}}}
mass

The dimensionless mass of the particle.

symbol

The symbol assigned to the dimensionless particle.

If no symbol was defined, then return the value given by repr.