We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Check consistency of argument ordering in physics
Here are a few example signatures straight from `physics.transport`:

```
def Coulomb_logarithm(n_e, T, particles, V=None):
def Debye_length(T_e, n_e):
def Debye_number(T_e, n_e):
def upper_hybrid_frequency(B, n_e):
```
It would be nice to ensure that non-keyword arguments, where applicable, have the same ordering - like in other scientific packages, like Numpy, a consistent API is helpful for being able to call multiple functions without having to check the signature each time you call them.

Any consistent ordering would be welcome - but common sense takes precedence.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `plasmapy/physics/transport.py`
Content:
```
1 """Functions to calculate transport coefficients."""
2 
3 from astropy import units
4 import numpy as np
5 from ..utils import check_quantity, _check_relativistic
6 from ..constants import (m_p, m_e, c, mu0, k_B, e, eps0, pi, h, hbar)
7 from ..atomic import (ion_mass, charge_state)
8 from .parameters import Debye_length
9 
10 
11 @check_quantity({"n_e": {"units": units.m**-3},
12                  "T": {"units": units.K, "can_be_negative": False}
13                  })
14 def Coulomb_logarithm(n_e, T, particles, V=None):
15     r"""Estimates the Coulomb logarithm.
16 
17     Parameters
18     ----------
19     n_e : Quantity
20         The electron density in units convertible to per cubic meter.
21 
22     T : Quantity
23         Temperature in units of temperature or energy per particle,
24         which is assumed to be equal for both the test particle and
25         the target particle
26 
27     particles : tuple
28         A tuple containing string representations of the test particle
29         (listed first) and the target particle (listed second)
30 
31     V : Quantity, optional
32         The relative velocity between particles.  If not provided,
33         thermal velocity is assumed: :math:`\mu V^2 \sim 3 k_B T`
34         where `mu` is the reduced mass.
35 
36     Returns
37     -------
38     lnLambda : float or numpy.ndarray
39         An estimate of the Coulomb logarithm that is accurate to
40         roughly its reciprocal.
41 
42     Raises
43     ------
44     ValueError
45         If the mass or charge of either particle cannot be found, or
46         any of the inputs contain incorrect values.
47 
48     UnitConversionError
49         If the units on any of the inputs are incorrect
50 
51     UserWarning
52         If the inputted velocity is greater than 80% of the speed of
53         light.
54 
55     TypeError
56         If the n_e, T, or V are not Quantities.
57 
58     Notes
59     -----
60     The Coulomb logarithm is given by
61 
62     .. math::
63     \ln{\Lambda} \equiv \ln\left( \frac{b_{max}}{b_{min}} \right)
64 
65     where :math:`b_{min}` and :math:`b_{max}` are the inner and outer
66     impact parameters for Coulomb collisions _[1].
67 
68     The outer impact parameter is given by the Debye length:
69     :math:`b_{min} = \lambda_D` which is a function of electron
70     temperature and electron density.  At distances greater than the
71     Debye length, electric fields from other particles will be
72     screened out due to electrons rearranging themselves.
73 
74     The choice of inner impact parameter is more controversial. There
75     are two main possibilities.  The first possibility is that the
76     inner impact parameter corresponds to a deflection angle of 90
77     degrees.  The second possibility is that the inner impact
78     parameter is a de Broglie wavelength, :math:`\lambda_B`
79     corresponding to the reduced mass of the two particles and the
80     relative velocity between collisions.  This function uses the
81     standard practice of choosing the inner impact parameter to be the
82     maximum of these two possibilities.  Some inconsistencies exist in
83     the literature on how to define the inner impact parameter _[2].
84 
85     Errors associated with the Coulomb logarithm are of order its
86     inverse If the Coulomb logarithm is of order unity, then the
87     assumptions made in the standard analysis of Coulomb collisions
88     are invalid.
89 
90     Examples
91     --------
92     >>> from astropy import units as u
93     >>> Coulomb_logarithm(T=1e6*units.K, n_e=1e19*units.m**-3, ('e', 'p'))
94     14.748259780491056
95     >>> Coulomb_logarithm(1e6*units.K, 1e19*units.m**-3, ('e', 'p'),
96                           V=1e6*u.m/u.s)
97 
98     References
99     ----------
100     .. [1] Physics of Fully Ionized Gases, L. Spitzer (1962)
101 
102     .. [2] Comparison of Coulomb Collision Rates in the Plasma Physics
103     and Magnetically Confined Fusion Literature, W. Fundamenski and
104     O.E. Garcia, EFDA–JET–R(07)01
105     (http://www.euro-fusionscipub.org/wp-content/uploads/2014/11/EFDR07001.pdf)
106 
107     """
108 
109     if not isinstance(particles, (list, tuple)) or len(particles) != 2:
110         raise ValueError("The third input of Coulomb_logarithm must be a list "
111                          "or tuple containing representations of two charged "
112                          "particles.")
113 
114     masses = np.zeros(2)*units.kg
115     charges = np.zeros(2)*units.C
116 
117     for particle, i in zip(particles, range(2)):
118 
119         try:
120             masses[i] = ion_mass(particles[i])
121         except Exception:
122             raise ValueError("Unable to find mass of particle: " +
123                              str(particles[i]) + " in Coulomb_logarithm.")
124 
125         try:
126             charges[i] = np.abs(e*charge_state(particles[i]))
127             if charges[i] is None:
128                 raise
129         except Exception:
130             raise ValueError("Unable to find charge of particle: " +
131                              str(particles[i]) + " in Coulomb_logarithm.")
132 
133     reduced_mass = masses[0] * masses[1] / (masses[0] + masses[1])
134 
135     # The outer impact parameter is the Debye length.  At distances
136     # greater than the Debye length, the electrostatic potential of a
137     # single particle is screened out by the electrostatic potentials
138     # of other particles.  Past this distance, the electric fields of
139     # individual particles do not affect each other much.  This
140     # expression neglects screening by heavier ions.
141 
142     T = T.to(units.K, equivalencies=units.temperature_energy())
143 
144     b_max = Debye_length(T, n_e)
145 
146     # The choice of inner impact parameter is more controversial.
147     # There are two broad possibilities, and the expressions in the
148     # literature often differ by factors of order unity or by
149     # interchanging the reduced mass with the test particle mass.
150 
151     # The relative velocity is a source of uncertainty.  It is
152     # reasonable to make an assumption relating the thermal energy to
153     # the kinetic energy: reduced_mass*velocity**2 is approximately
154     # equal to 3*k_B*T.
155 
156     # If no relative velocity is inputted, then we make an assumption
157     # that relates the thermal energy to the kinetic energy:
158     # reduced_mass*velocity**2 is approximately equal to 3*k_B*T.
159 
160     if V is None:
161         V = np.sqrt(3 * k_B * T / reduced_mass)
162     else:
163         _check_relativistic(V, 'Coulomb_logarithm', betafrac=0.8)
164 
165     # The first possibility is that the inner impact parameter
166     # corresponds to a deflection of 90 degrees, which is valid when
167     # classical effects dominate.
168 
169     b_perp = charges[0] * charges[1] / (4 * pi * eps0 * reduced_mass * V**2)
170 
171     # The second possibility is that the inner impact parameter is a
172     # de Broglie wavelength.  There remains some ambiguity as to which
173     # mass to choose to go into the de Broglie wavelength calculation.
174     # Here we use the reduced mass, which will be of the same order as
175     # mass of the smaller particle and thus the longer de Broglie
176     # wavelength.
177 
178     b_deBroglie = hbar / (2 * reduced_mass * V)
179 
180     # Coulomb-style collisions will not happen for impact parameters
181     # shorter than either of these two impact parameters, so we choose
182     # the larger of these two possibilities.
183 
184     b_min = np.zeros_like(b_perp)
185 
186     for i in range(b_min.size):
187 
188         if b_perp.flat[i] > b_deBroglie.flat[i]:
189             b_min.flat[i] = b_perp.flat[i]
190         else:
191             b_min.flat[i] = b_deBroglie.flat[i]
192 
193     # Now that we know how many approximations have to go into plasma
194     # transport theory, we shall celebrate by returning the Coulomb
195     # logarithm.
196 
197     ln_Lambda = np.log(b_max/b_min)
198     ln_Lambda = ln_Lambda.to(units.dimensionless_unscaled).value
199 
200     return ln_Lambda
201
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/plasmapy/physics/transport.py b/plasmapy/physics/transport.py
--- a/plasmapy/physics/transport.py
+++ b/plasmapy/physics/transport.py
@@ -8,21 +8,22 @@
 from .parameters import Debye_length
 
 
-@check_quantity({"n_e": {"units": units.m**-3},
-                 "T": {"units": units.K, "can_be_negative": False}
+@check_quantity({"T": {"units": units.K, "can_be_negative": False},
+                 "n_e": {"units": units.m**-3}
                  })
-def Coulomb_logarithm(n_e, T, particles, V=None):
+def Coulomb_logarithm(T, n_e, particles, V=None):
     r"""Estimates the Coulomb logarithm.
 
     Parameters
     ----------
-    n_e : Quantity
-        The electron density in units convertible to per cubic meter.
 
     T : Quantity
-        Temperature in units of temperature or energy per particle,
-        which is assumed to be equal for both the test particle and
-        the target particle
+    Temperature in units of temperature or energy per particle,
+    which is assumed to be equal for both the test particle and
+    the target particle
+
+    n_e : Quantity
+        The electron density in units convertible to per cubic meter.
 
     particles : tuple
         A tuple containing string representations of the test particle
@@ -90,9 +91,9 @@
     Examples
     --------
     >>> from astropy import units as u
-    >>> Coulomb_logarithm(T=1e6*units.K, n_e=1e19*units.m**-3, ('e', 'p'))
+    >>> Coulomb_logarithm(T=1e6*u.K, n_e=1e19*u.m**-3, ('e', 'p'))
     14.748259780491056
-    >>> Coulomb_logarithm(1e6*units.K, 1e19*units.m**-3, ('e', 'p'),
+    >>> Coulomb_logarithm(1e6*u.K, 1e19*u.m**-3, ('e', 'p'),
                           V=1e6*u.m/u.s)
 
     References

{"golden_diff": "diff --git a/plasmapy/physics/transport.py b/plasmapy/physics/transport.py\n--- a/plasmapy/physics/transport.py\n+++ b/plasmapy/physics/transport.py\n@@ -8,21 +8,22 @@\n from .parameters import Debye_length\n \n \n-@check_quantity({\"n_e\": {\"units\": units.m**-3},\n-                 \"T\": {\"units\": units.K, \"can_be_negative\": False}\n+@check_quantity({\"T\": {\"units\": units.K, \"can_be_negative\": False},\n+                 \"n_e\": {\"units\": units.m**-3}\n                  })\n-def Coulomb_logarithm(n_e, T, particles, V=None):\n+def Coulomb_logarithm(T, n_e, particles, V=None):\n     r\"\"\"Estimates the Coulomb logarithm.\n \n     Parameters\n     ----------\n-    n_e : Quantity\n-        The electron density in units convertible to per cubic meter.\n \n     T : Quantity\n-        Temperature in units of temperature or energy per particle,\n-        which is assumed to be equal for both the test particle and\n-        the target particle\n+    Temperature in units of temperature or energy per particle,\n+    which is assumed to be equal for both the test particle and\n+    the target particle\n+\n+    n_e : Quantity\n+        The electron density in units convertible to per cubic meter.\n \n     particles : tuple\n         A tuple containing string representations of the test particle\n@@ -90,9 +91,9 @@\n     Examples\n     --------\n     >>> from astropy import units as u\n-    >>> Coulomb_logarithm(T=1e6*units.K, n_e=1e19*units.m**-3, ('e', 'p'))\n+    >>> Coulomb_logarithm(T=1e6*u.K, n_e=1e19*u.m**-3, ('e', 'p'))\n     14.748259780491056\n-    >>> Coulomb_logarithm(1e6*units.K, 1e19*units.m**-3, ('e', 'p'),\n+    >>> Coulomb_logarithm(1e6*u.K, 1e19*u.m**-3, ('e', 'p'),\n                           V=1e6*u.m/u.s)\n \n     References\n", "issue": "Check consistency of argument ordering in physics\nHere are a few example signatures straight from `physics.transport`:\r\n\r\n```\r\ndef Coulomb_logarithm(n_e, T, particles, V=None):\r\ndef Debye_length(T_e, n_e):\r\ndef Debye_number(T_e, n_e):\r\ndef upper_hybrid_frequency(B, n_e):\r\n```\r\nIt would be nice to ensure that non-keyword arguments, where applicable, have the same ordering - like in other scientific packages, like Numpy, a consistent API is helpful for being able to call multiple functions without having to check the signature each time you call them.\r\n\r\nAny consistent ordering would be welcome - but common sense takes precedence.\n", "before_files": [{"content": "\"\"\"Functions to calculate transport coefficients.\"\"\"\n\nfrom astropy import units\nimport numpy as np\nfrom ..utils import check_quantity, _check_relativistic\nfrom ..constants import (m_p, m_e, c, mu0, k_B, e, eps0, pi, h, hbar)\nfrom ..atomic import (ion_mass, charge_state)\nfrom .parameters import Debye_length\n\n\n@check_quantity({\"n_e\": {\"units\": units.m**-3},\n                 \"T\": {\"units\": units.K, \"can_be_negative\": False}\n                 })\ndef Coulomb_logarithm(n_e, T, particles, V=None):\n    r\"\"\"Estimates the Coulomb logarithm.\n\n    Parameters\n    ----------\n    n_e : Quantity\n        The electron density in units convertible to per cubic meter.\n\n    T : Quantity\n        Temperature in units of temperature or energy per particle,\n        which is assumed to be equal for both the test particle and\n        the target particle\n\n    particles : tuple\n        A tuple containing string representations of the test particle\n        (listed first) and the target particle (listed second)\n\n    V : Quantity, optional\n        The relative velocity between particles.  If not provided,\n        thermal velocity is assumed: :math:`\\mu V^2 \\sim 3 k_B T`\n        where `mu` is the reduced mass.\n\n    Returns\n    -------\n    lnLambda : float or numpy.ndarray\n        An estimate of the Coulomb logarithm that is accurate to\n        roughly its reciprocal.\n\n    Raises\n    ------\n    ValueError\n        If the mass or charge of either particle cannot be found, or\n        any of the inputs contain incorrect values.\n\n    UnitConversionError\n        If the units on any of the inputs are incorrect\n\n    UserWarning\n        If the inputted velocity is greater than 80% of the speed of\n        light.\n\n    TypeError\n        If the n_e, T, or V are not Quantities.\n\n    Notes\n    -----\n    The Coulomb logarithm is given by\n\n    .. math::\n    \\ln{\\Lambda} \\equiv \\ln\\left( \\frac{b_{max}}{b_{min}} \\right)\n\n    where :math:`b_{min}` and :math:`b_{max}` are the inner and outer\n    impact parameters for Coulomb collisions _[1].\n\n    The outer impact parameter is given by the Debye length:\n    :math:`b_{min} = \\lambda_D` which is a function of electron\n    temperature and electron density.  At distances greater than the\n    Debye length, electric fields from other particles will be\n    screened out due to electrons rearranging themselves.\n\n    The choice of inner impact parameter is more controversial. There\n    are two main possibilities.  The first possibility is that the\n    inner impact parameter corresponds to a deflection angle of 90\n    degrees.  The second possibility is that the inner impact\n    parameter is a de Broglie wavelength, :math:`\\lambda_B`\n    corresponding to the reduced mass of the two particles and the\n    relative velocity between collisions.  This function uses the\n    standard practice of choosing the inner impact parameter to be the\n    maximum of these two possibilities.  Some inconsistencies exist in\n    the literature on how to define the inner impact parameter _[2].\n\n    Errors associated with the Coulomb logarithm are of order its\n    inverse If the Coulomb logarithm is of order unity, then the\n    assumptions made in the standard analysis of Coulomb collisions\n    are invalid.\n\n    Examples\n    --------\n    >>> from astropy import units as u\n    >>> Coulomb_logarithm(T=1e6*units.K, n_e=1e19*units.m**-3, ('e', 'p'))\n    14.748259780491056\n    >>> Coulomb_logarithm(1e6*units.K, 1e19*units.m**-3, ('e', 'p'),\n                          V=1e6*u.m/u.s)\n\n    References\n    ----------\n    .. [1] Physics of Fully Ionized Gases, L. Spitzer (1962)\n\n    .. [2] Comparison of Coulomb Collision Rates in the Plasma Physics\n    and Magnetically Confined Fusion Literature, W. Fundamenski and\n    O.E. Garcia, EFDA\u2013JET\u2013R(07)01\n    (http://www.euro-fusionscipub.org/wp-content/uploads/2014/11/EFDR07001.pdf)\n\n    \"\"\"\n\n    if not isinstance(particles, (list, tuple)) or len(particles) != 2:\n        raise ValueError(\"The third input of Coulomb_logarithm must be a list \"\n                         \"or tuple containing representations of two charged \"\n                         \"particles.\")\n\n    masses = np.zeros(2)*units.kg\n    charges = np.zeros(2)*units.C\n\n    for particle, i in zip(particles, range(2)):\n\n        try:\n            masses[i] = ion_mass(particles[i])\n        except Exception:\n            raise ValueError(\"Unable to find mass of particle: \" +\n                             str(particles[i]) + \" in Coulomb_logarithm.\")\n\n        try:\n            charges[i] = np.abs(e*charge_state(particles[i]))\n            if charges[i] is None:\n                raise\n        except Exception:\n            raise ValueError(\"Unable to find charge of particle: \" +\n                             str(particles[i]) + \" in Coulomb_logarithm.\")\n\n    reduced_mass = masses[0] * masses[1] / (masses[0] + masses[1])\n\n    # The outer impact parameter is the Debye length.  At distances\n    # greater than the Debye length, the electrostatic potential of a\n    # single particle is screened out by the electrostatic potentials\n    # of other particles.  Past this distance, the electric fields of\n    # individual particles do not affect each other much.  This\n    # expression neglects screening by heavier ions.\n\n    T = T.to(units.K, equivalencies=units.temperature_energy())\n\n    b_max = Debye_length(T, n_e)\n\n    # The choice of inner impact parameter is more controversial.\n    # There are two broad possibilities, and the expressions in the\n    # literature often differ by factors of order unity or by\n    # interchanging the reduced mass with the test particle mass.\n\n    # The relative velocity is a source of uncertainty.  It is\n    # reasonable to make an assumption relating the thermal energy to\n    # the kinetic energy: reduced_mass*velocity**2 is approximately\n    # equal to 3*k_B*T.\n\n    # If no relative velocity is inputted, then we make an assumption\n    # that relates the thermal energy to the kinetic energy:\n    # reduced_mass*velocity**2 is approximately equal to 3*k_B*T.\n\n    if V is None:\n        V = np.sqrt(3 * k_B * T / reduced_mass)\n    else:\n        _check_relativistic(V, 'Coulomb_logarithm', betafrac=0.8)\n\n    # The first possibility is that the inner impact parameter\n    # corresponds to a deflection of 90 degrees, which is valid when\n    # classical effects dominate.\n\n    b_perp = charges[0] * charges[1] / (4 * pi * eps0 * reduced_mass * V**2)\n\n    # The second possibility is that the inner impact parameter is a\n    # de Broglie wavelength.  There remains some ambiguity as to which\n    # mass to choose to go into the de Broglie wavelength calculation.\n    # Here we use the reduced mass, which will be of the same order as\n    # mass of the smaller particle and thus the longer de Broglie\n    # wavelength.\n\n    b_deBroglie = hbar / (2 * reduced_mass * V)\n\n    # Coulomb-style collisions will not happen for impact parameters\n    # shorter than either of these two impact parameters, so we choose\n    # the larger of these two possibilities.\n\n    b_min = np.zeros_like(b_perp)\n\n    for i in range(b_min.size):\n\n        if b_perp.flat[i] > b_deBroglie.flat[i]:\n            b_min.flat[i] = b_perp.flat[i]\n        else:\n            b_min.flat[i] = b_deBroglie.flat[i]\n\n    # Now that we know how many approximations have to go into plasma\n    # transport theory, we shall celebrate by returning the Coulomb\n    # logarithm.\n\n    ln_Lambda = np.log(b_max/b_min)\n    ln_Lambda = ln_Lambda.to(units.dimensionless_unscaled).value\n\n    return ln_Lambda\n", "path": "plasmapy/physics/transport.py"}], "after_files": [{"content": "\"\"\"Functions to calculate transport coefficients.\"\"\"\n\nfrom astropy import units\nimport numpy as np\nfrom ..utils import check_quantity, _check_relativistic\nfrom ..constants import (m_p, m_e, c, mu0, k_B, e, eps0, pi, h, hbar)\nfrom ..atomic import (ion_mass, charge_state)\nfrom .parameters import Debye_length\n\n\n@check_quantity({\"T\": {\"units\": units.K, \"can_be_negative\": False},\n                 \"n_e\": {\"units\": units.m**-3}\n                 })\ndef Coulomb_logarithm(T, n_e, particles, V=None):\n    r\"\"\"Estimates the Coulomb logarithm.\n\n    Parameters\n    ----------\n\n    T : Quantity\n    Temperature in units of temperature or energy per particle,\n    which is assumed to be equal for both the test particle and\n    the target particle\n\n    n_e : Quantity\n        The electron density in units convertible to per cubic meter.\n\n    particles : tuple\n        A tuple containing string representations of the test particle\n        (listed first) and the target particle (listed second)\n\n    V : Quantity, optional\n        The relative velocity between particles.  If not provided,\n        thermal velocity is assumed: :math:`\\mu V^2 \\sim 3 k_B T`\n        where `mu` is the reduced mass.\n\n    Returns\n    -------\n    lnLambda : float or numpy.ndarray\n        An estimate of the Coulomb logarithm that is accurate to\n        roughly its reciprocal.\n\n    Raises\n    ------\n    ValueError\n        If the mass or charge of either particle cannot be found, or\n        any of the inputs contain incorrect values.\n\n    UnitConversionError\n        If the units on any of the inputs are incorrect\n\n    UserWarning\n        If the inputted velocity is greater than 80% of the speed of\n        light.\n\n    TypeError\n        If the n_e, T, or V are not Quantities.\n\n    Notes\n    -----\n    The Coulomb logarithm is given by\n\n    .. math::\n    \\ln{\\Lambda} \\equiv \\ln\\left( \\frac{b_{max}}{b_{min}} \\right)\n\n    where :math:`b_{min}` and :math:`b_{max}` are the inner and outer\n    impact parameters for Coulomb collisions _[1].\n\n    The outer impact parameter is given by the Debye length:\n    :math:`b_{min} = \\lambda_D` which is a function of electron\n    temperature and electron density.  At distances greater than the\n    Debye length, electric fields from other particles will be\n    screened out due to electrons rearranging themselves.\n\n    The choice of inner impact parameter is more controversial. There\n    are two main possibilities.  The first possibility is that the\n    inner impact parameter corresponds to a deflection angle of 90\n    degrees.  The second possibility is that the inner impact\n    parameter is a de Broglie wavelength, :math:`\\lambda_B`\n    corresponding to the reduced mass of the two particles and the\n    relative velocity between collisions.  This function uses the\n    standard practice of choosing the inner impact parameter to be the\n    maximum of these two possibilities.  Some inconsistencies exist in\n    the literature on how to define the inner impact parameter _[2].\n\n    Errors associated with the Coulomb logarithm are of order its\n    inverse If the Coulomb logarithm is of order unity, then the\n    assumptions made in the standard analysis of Coulomb collisions\n    are invalid.\n\n    Examples\n    --------\n    >>> from astropy import units as u\n    >>> Coulomb_logarithm(T=1e6*u.K, n_e=1e19*u.m**-3, ('e', 'p'))\n    14.748259780491056\n    >>> Coulomb_logarithm(1e6*u.K, 1e19*u.m**-3, ('e', 'p'),\n                          V=1e6*u.m/u.s)\n\n    References\n    ----------\n    .. [1] Physics of Fully Ionized Gases, L. Spitzer (1962)\n\n    .. [2] Comparison of Coulomb Collision Rates in the Plasma Physics\n    and Magnetically Confined Fusion Literature, W. Fundamenski and\n    O.E. Garcia, EFDA\u2013JET\u2013R(07)01\n    (http://www.euro-fusionscipub.org/wp-content/uploads/2014/11/EFDR07001.pdf)\n\n    \"\"\"\n\n    if not isinstance(particles, (list, tuple)) or len(particles) != 2:\n        raise ValueError(\"The third input of Coulomb_logarithm must be a list \"\n                         \"or tuple containing representations of two charged \"\n                         \"particles.\")\n\n    masses = np.zeros(2)*units.kg\n    charges = np.zeros(2)*units.C\n\n    for particle, i in zip(particles, range(2)):\n\n        try:\n            masses[i] = ion_mass(particles[i])\n        except Exception:\n            raise ValueError(\"Unable to find mass of particle: \" +\n                             str(particles[i]) + \" in Coulomb_logarithm.\")\n\n        try:\n            charges[i] = np.abs(e*charge_state(particles[i]))\n            if charges[i] is None:\n                raise\n        except Exception:\n            raise ValueError(\"Unable to find charge of particle: \" +\n                             str(particles[i]) + \" in Coulomb_logarithm.\")\n\n    reduced_mass = masses[0] * masses[1] / (masses[0] + masses[1])\n\n    # The outer impact parameter is the Debye length.  At distances\n    # greater than the Debye length, the electrostatic potential of a\n    # single particle is screened out by the electrostatic potentials\n    # of other particles.  Past this distance, the electric fields of\n    # individual particles do not affect each other much.  This\n    # expression neglects screening by heavier ions.\n\n    T = T.to(units.K, equivalencies=units.temperature_energy())\n\n    b_max = Debye_length(T, n_e)\n\n    # The choice of inner impact parameter is more controversial.\n    # There are two broad possibilities, and the expressions in the\n    # literature often differ by factors of order unity or by\n    # interchanging the reduced mass with the test particle mass.\n\n    # The relative velocity is a source of uncertainty.  It is\n    # reasonable to make an assumption relating the thermal energy to\n    # the kinetic energy: reduced_mass*velocity**2 is approximately\n    # equal to 3*k_B*T.\n\n    # If no relative velocity is inputted, then we make an assumption\n    # that relates the thermal energy to the kinetic energy:\n    # reduced_mass*velocity**2 is approximately equal to 3*k_B*T.\n\n    if V is None:\n        V = np.sqrt(3 * k_B * T / reduced_mass)\n    else:\n        _check_relativistic(V, 'Coulomb_logarithm', betafrac=0.8)\n\n    # The first possibility is that the inner impact parameter\n    # corresponds to a deflection of 90 degrees, which is valid when\n    # classical effects dominate.\n\n    b_perp = charges[0] * charges[1] / (4 * pi * eps0 * reduced_mass * V**2)\n\n    # The second possibility is that the inner impact parameter is a\n    # de Broglie wavelength.  There remains some ambiguity as to which\n    # mass to choose to go into the de Broglie wavelength calculation.\n    # Here we use the reduced mass, which will be of the same order as\n    # mass of the smaller particle and thus the longer de Broglie\n    # wavelength.\n\n    b_deBroglie = hbar / (2 * reduced_mass * V)\n\n    # Coulomb-style collisions will not happen for impact parameters\n    # shorter than either of these two impact parameters, so we choose\n    # the larger of these two possibilities.\n\n    b_min = np.zeros_like(b_perp)\n\n    for i in range(b_min.size):\n\n        if b_perp.flat[i] > b_deBroglie.flat[i]:\n            b_min.flat[i] = b_perp.flat[i]\n        else:\n            b_min.flat[i] = b_deBroglie.flat[i]\n\n    # Now that we know how many approximations have to go into plasma\n    # transport theory, we shall celebrate by returning the Coulomb\n    # logarithm.\n\n    ln_Lambda = np.log(b_max/b_min)\n    ln_Lambda = ln_Lambda.to(units.dimensionless_unscaled).value\n\n    return ln_Lambda\n", "path": "plasmapy/physics/transport.py"}]}