32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
---
|
|
title: combine_counts
|
|
description: API reference for qiskit.ignis.verification.combine_counts
|
|
in_page_toc_min_heading_level: 1
|
|
python_api_type: function
|
|
python_api_name: qiskit.ignis.verification.combine_counts
|
|
---
|
|
|
|
# qiskit.ignis.verification.combine\_counts
|
|
|
|
<Function id="qiskit.ignis.verification.combine_counts" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.7/qiskit/ignis/verification/tomography/data.py" signature="combine_counts(counts1, counts2)">
|
|
Combine two counts dictionaries. :type counts1: `Dict`\[`str`, `int`] :param counts1: One of the count dictionaries to combine. :type counts2: `Dict`\[`str`, `int`] :param counts2: One of the count dictionaries to combine.
|
|
|
|
**Return type**
|
|
|
|
`Dict`\[`str`, `int`]
|
|
|
|
**Returns**
|
|
|
|
A dict containing the **sum** of entries in counts1 and counts2 where a nonexisting entry is treated as 0
|
|
|
|
**Example**
|
|
|
|
```python
|
|
>>> counts1 = {'00': 3, '01': 5}
|
|
>>> counts2 = {'00': 4, '10': 7}
|
|
>>> combine_counts(counts1, counts2)
|
|
{'00': 7, '01': 5, '10': 7}
|
|
```
|
|
</Function>
|
|
|