• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hgrecco / pint / 1149 / 8
92%
master: 91%

Build:
Build:
LAST BUILD BRANCH: fix-nonmult-doc
DEFAULT BRANCH: master
Ran 22 Jul 2019 08:03PM UTC
Files 16
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Jul 2019 07:56PM UTC coverage: 85.671%. Remained the same
UNCERTAINTIES="N" PYTHON="2.7" NUMPY_VERSION=1.14 PANDAS=0

push

travis-ci

bors[bot]
Merge #834

834: Atomic units for intensity and electric field r=hgrecco a=Schoyen

Thanks for a cool project!

When working with atomic systems subject to laser fields it is common to write the intensity of the laser fields in units of `W/cm^2`, but when doing numerical simulations the laser fields are almost always defined in atomic units. I've therefore added the atomic unit for the electric field and the atomic unit for intensity as defined in the book "Atoms in Intense Laser Fields" by Joachain et al. equations (1.1) and (1.2).

```python
>>> import pint
>>> ureg = pint.UnitRegistry()
>>> ureg.Quantity(1, ureg.a_u_electric_field)
<Quantity(1, 'atomic_unit_of_electric_field')>
>>> ureg.Quantity(1, ureg.a_u_electric_field).to(ureg.volt / ureg.cm)
<Quantity(5142206747.6231785, 'volt / centimeter')>
>>> ureg.Quantity(1, ureg.a_u_electric_field).to(ureg.volt / ureg.cm) / 1e9  # Should be ~ 5.1e9 V/cm
<Quantity(5.142206747623178, 'volt / centimeter')>
>>> ureg.Quantity(1, ureg.a_u_intensity)
<Quantity(1, 'atomic_unit_of_intensity')>
>>> ureg.Quantity(1, ureg.a_u_intensity).to(ureg.watt / ureg.cm ** 2)
<Quantity(3.5094455205664776e+16, 'watt / centimeter ** 2')>
>>> ureg.Quantity(1, ureg.a_u_intensity).to(ureg.watt / ureg.cm ** 2) / 1e16  # Should be ~ 3.5e16 W/cm^2
<Quantity(3.5094455205664774, 'watt / centimeter ** 2')>
```

I'd be happy to add tests for these quantities if this is requested, but I was a little unsure as to where they should go.

Co-authored-by: Øyvind Sigmundson Schøyen <oyvindschoyen@gmail.com>

2840 of 3315 relevant lines covered (85.67%)

0.86 hits per line

Source Files on job 1149.8 (UNCERTAINTIES="N" PYTHON="2.7" NUMPY_VERSION=1.14 PANDAS=0)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1079
  • Travis Job 1149.8
  • 5ede9629 on github
  • Prev Job for UNCERTAINTIES="N" PYTHON="2.7" NUMPY_VERSION=1.14 PANDAS=0 on staging (#1147.8)
  • Next Job for UNCERTAINTIES="N" PYTHON="2.7" NUMPY_VERSION=1.14 PANDAS=0 on staging (#1151.8)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc