Skip to content

Commit

Permalink
Fix incorrect computation of excited state population (#1672)
Browse files Browse the repository at this point in the history
This commits fixed a bug in NoiseModel.from_backend where using the temperature kwarg with
a non-default value would incorrectly compute the excited state population for the specified temperature.
Previously, there was an additional factor of 2 in the Boltzman distribution calculation leading to
an incorrect smaller value for the excited state population.

* Fix a bug in computation of excited population
* Improve reno
* Reword reno
  • Loading branch information
itoko authored Dec 2, 2022
1 parent bce3150 commit 58b86e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 8 additions & 6 deletions qiskit_aer/noise/device/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,19 @@ def _truncate_t2_value(t1, t2):


def _excited_population(freq, temperature):
"""Return excited state population"""
"""Return excited state population from freq [GHz] and temperature [mK]."""
population = 0
if freq != inf and temperature != 0:
# Compute the excited state population from qubit
# frequency and temperature
# Boltzman constant kB = 8.617333262-5 (eV/K)
# Compute the excited state population from qubit frequency and temperature
# based on Maxwell-Boltzmann distribution
# considering only qubit states (|0> and |1>), i.e. truncating higher energy states.
# Boltzman constant kB = 8.617333262e-5 (eV/K)
# Planck constant h = 4.135667696e-15 (eV.s)
# qubit temperature temperatue = T (mK)
# qubit frequency frequency = f (GHz)
# excited state population = 1/(1+exp((2*h*f*1e9)/(kb*T*1e-3)))
exp_param = exp((95.9849 * freq) / abs(temperature))
# excited state population = 1/(1+exp((h*f*1e9)/(kb*T*1e-3)))
# See e.g. Phys. Rev. Lett. 114, 240501 (2015).
exp_param = exp((47.99243 * freq) / abs(temperature))
population = 1 / (1 + exp_param)
if temperature < 0:
# negative temperate implies |1> is thermal ground
Expand Down
8 changes: 8 additions & 0 deletions releasenotes/notes/fix-temperature-a9c51c4599af3a49.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixes:
- |
Fixed a bug in :meth:`NoiseModel.from_backend` where using the ``temperature`` kwarg with
a non-default value would incorrectly compute the excited state population for
the specified temperature. Previously, there was an additional factor of 2 in
the Boltzman distribution calculation leading to an incorrect smaller value
for the excited state population.

0 comments on commit 58b86e1

Please sign in to comment.