charge_number

plasmapy.particles.atomic.charge_number(particle: str | int | integer | Particle | CustomParticle | Quantity) int[source]

Return the charge number of a particle.

Parameters:

particle (particle-like) – String representing a particle.

Returns:

The charge as a multiple of the elementary charge.

Return type:

int

Raises:
  • InvalidParticleError – If the argument does not correspond to a valid particle or contradictory information is provided.

  • ChargeError – If charge information for the particle is not available.

  • ParticleWarning – If the input represents an ion with a charge number that is less than or equal to -3, which is unlikely to occur in nature.

Notes

This function supports two formats for charge number information.

The first format is a string that has information for the element or isotope at the beginning, a space in between, and the charge number information in the form of an integer followed by a plus or minus sign, or a plus or minus sign followed by an integer.

The second format is a string containing element information at the beginning, following by one or more plus or minus signs.

Examples

>>> charge_number("Fe-56 2+")
2
>>> charge_number("He -2")
-2
>>> charge_number("H+")
1
>>> charge_number("N-14++")
2