correlation-analysis


Namecorrelation-analysis JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryHigh order correlation analysis of error models.
upload_time2024-04-16 04:23:06
maintainerNone
docs_urlNone
authorYiming Zhang
requires_python>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # correlation
High order correlation analysis of detector error models

## Installation

```shell
pip install correlation_analysis
```

## Usage

```python
import stim

import correlation

circuit = stim.Circuit.generated(
    code_task='surface_code:rotated_memory_z',
    distance=3,
    rounds=2,
    after_clifford_depolarization=0.01,
    after_reset_flip_probability=0.01,
    before_measure_flip_probability=0.01,
    before_round_data_depolarization=0.01,
)
dets = circuit.compile_detector_sampler().sample(shots=1_000_000)
dem = circuit.detector_error_model(decompose_errors=True)
graph = correlation.TannerGraph(dem)
result = correlation.cal_high_order_correlations(dets, graph.hyperedges, num_workers=16)
prob_from_dem = []
prob_from_correlation = []
for hyperedge, prob in graph.hyperedge_probs.items():
    prob_from_dem.append(prob)
    prob_from_correlation.append(result.get(hyperedge))

print("Probabilities from detector error model:")
print(prob_from_dem)
print("Probabilities from correlation analysis:")
print(prob_from_correlation)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "correlation-analysis",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Yiming Zhang",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/76/22/27c7004cc2b27d6ab08b69deda1aa51970053a14aa5e6ca7da0d762d471a/correlation_analysis-0.1.0.tar.gz",
    "platform": null,
    "description": "# correlation\nHigh order correlation analysis of detector error models\n\n## Installation\n\n```shell\npip install correlation_analysis\n```\n\n## Usage\n\n```python\nimport stim\n\nimport correlation\n\ncircuit = stim.Circuit.generated(\n    code_task='surface_code:rotated_memory_z',\n    distance=3,\n    rounds=2,\n    after_clifford_depolarization=0.01,\n    after_reset_flip_probability=0.01,\n    before_measure_flip_probability=0.01,\n    before_round_data_depolarization=0.01,\n)\ndets = circuit.compile_detector_sampler().sample(shots=1_000_000)\ndem = circuit.detector_error_model(decompose_errors=True)\ngraph = correlation.TannerGraph(dem)\nresult = correlation.cal_high_order_correlations(dets, graph.hyperedges, num_workers=16)\nprob_from_dem = []\nprob_from_correlation = []\nfor hyperedge, prob in graph.hyperedge_probs.items():\n    prob_from_dem.append(prob)\n    prob_from_correlation.append(result.get(hyperedge))\n\nprint(\"Probabilities from detector error model:\")\nprint(prob_from_dem)\nprint(\"Probabilities from correlation analysis:\")\nprint(prob_from_correlation)\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "High order correlation analysis of error models.",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21b5f5e764d6b76a9c61aefcdef57668b827a634141aa976be6f412c3ff5377c",
                "md5": "fa0f80d76dc52240db91c5b18e38a1fc",
                "sha256": "11aed03d7bc42f7dea14f624e65d1a4db6b8b8e12add28f01f2a96c0ac2b8029"
            },
            "downloads": -1,
            "filename": "correlation_analysis-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa0f80d76dc52240db91c5b18e38a1fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 14788,
            "upload_time": "2024-04-16T04:23:04",
            "upload_time_iso_8601": "2024-04-16T04:23:04.913379Z",
            "url": "https://files.pythonhosted.org/packages/21/b5/f5e764d6b76a9c61aefcdef57668b827a634141aa976be6f412c3ff5377c/correlation_analysis-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "762227c7004cc2b27d6ab08b69deda1aa51970053a14aa5e6ca7da0d762d471a",
                "md5": "f33e3238bc2c38c562cc10de25e8f875",
                "sha256": "47e1cf4cf916ac483ccc22579691aaaabaa334cd50d6c75ac03f5a9505858858"
            },
            "downloads": -1,
            "filename": "correlation_analysis-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f33e3238bc2c38c562cc10de25e8f875",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12724,
            "upload_time": "2024-04-16T04:23:06",
            "upload_time_iso_8601": "2024-04-16T04:23:06.432974Z",
            "url": "https://files.pythonhosted.org/packages/76/22/27c7004cc2b27d6ab08b69deda1aa51970053a14aa5e6ca7da0d762d471a/correlation_analysis-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 04:23:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "correlation-analysis"
}
        
Elapsed time: 0.86646s