Copy disabled (too large)
Download .txt
Showing preview only (11,489K chars total). Download the full file to get everything.
Repository: Quandela/Perceval
Branch: main
Commit: 0f2bcdb4984c
Files: 418
Total size: 10.9 MB
Directory structure:
gitextract_lva1xgfi/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── rendering_requirements.txt
│ └── workflows/
│ ├── autotests.yml
│ ├── benchmarks.yml
│ ├── build-and-deploy-docs.yml
│ ├── python-publish.yml
│ ├── rerun-notebooks-and-build-docs.yml
│ └── rerun_notebooks.sh
├── .gitignore
├── .pre-commit-config.yaml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── benchmark/
│ ├── benchmark-circuit-building.py
│ ├── benchmark-unitary.py
│ ├── benchmark_QML-DE-solver.py
│ ├── benchmark_bosonsampling.py
│ ├── benchmark_pdisplay.py
│ └── benchmark_stepper.py
├── conftest.py
├── docs/
│ ├── Makefile
│ ├── make.bat
│ ├── multiversion_config/
│ │ └── conf.py
│ ├── requirements.txt
│ └── source/
│ ├── _static/
│ │ └── css/
│ │ └── style.css
│ ├── _templates/
│ │ ├── layout.html
│ │ ├── page.html
│ │ └── versions.html
│ ├── backends.rst
│ ├── bibliography.rst
│ ├── build_catalog.py
│ ├── conf.py
│ ├── contributing.rst
│ ├── examples_boson_sampling.rst
│ ├── examples_others.rst
│ ├── examples_quantum_walk.rst
│ ├── examples_standard_algo.rst
│ ├── examples_vqa.rst
│ ├── getting_started.rst
│ ├── index.rst
│ ├── legacy.rst
│ ├── notebooks/
│ │ ├── 2-mode_Grover_algorithm.ipynb
│ │ ├── Advanced_state_tutorial.ipynb
│ │ ├── BS-based_implementation.ipynb
│ │ ├── Boson_Bunching.ipynb
│ │ ├── Boson_sampling.ipynb
│ │ ├── Circuit_Tutorial.ipynb
│ │ ├── Computation_Tutorial.ipynb
│ │ ├── Density_matrix_Fock_space.ipynb
│ │ ├── Differential_equation_resolution.ipynb
│ │ ├── Encoding_Tutorial.ipynb
│ │ ├── Gedik_qudit.ipynb
│ │ ├── Graph_States_Tutorial.ipynb
│ │ ├── LOv_rewriting_rules.ipynb
│ │ ├── MPS_techniques_for_boson_sampling.ipynb
│ │ ├── QLOQ_QUBO_tutorial.ipynb
│ │ ├── QUBO.ipynb
│ │ ├── Quantum_teleportation_feed_forward.ipynb
│ │ ├── Reinforcement_learning.ipynb
│ │ ├── Remote_Computation_Tutorial.ipynb
│ │ ├── Shor_Implementation.ipynb
│ │ ├── Simulation_non-unitary_components.ipynb
│ │ ├── State_Tutorial.ipynb
│ │ ├── Tomography_walkthrough.ipynb
│ │ ├── Two-particle_bosonic-fermionic_quantum_walk.ipynb
│ │ ├── VQA_Tutorial.ipynb
│ │ ├── Variational_Quantum_Eigensolver.ipynb
│ │ ├── Walkthrough-cnot.ipynb
│ │ ├── quantum_kernel_methods.ipynb
│ │ └── requirements.txt
│ ├── reference/
│ │ ├── algorithm/
│ │ │ ├── analyzer.rst
│ │ │ ├── index.rst
│ │ │ ├── sampler.rst
│ │ │ └── tomography.rst
│ │ ├── backends/
│ │ │ ├── clifford2017.rst
│ │ │ ├── index.rst
│ │ │ ├── mps.rst
│ │ │ ├── naive.rst
│ │ │ ├── naive_approx.rst
│ │ │ ├── slap.rst
│ │ │ └── slos.rst
│ │ ├── components/
│ │ │ ├── catalog.rst
│ │ │ ├── circuit.rst
│ │ │ ├── detector.rst
│ │ │ ├── experiment.rst
│ │ │ ├── feed_forward_configurator.rst
│ │ │ ├── generic_interferometer.rst
│ │ │ ├── index.rst
│ │ │ ├── non_unitary_components.rst
│ │ │ ├── port.rst
│ │ │ ├── processor.rst
│ │ │ ├── source.rst
│ │ │ └── unitary_components.rst
│ │ ├── error_mitigation.rst
│ │ ├── exqalibur/
│ │ │ ├── circuit_optimizer.rst
│ │ │ ├── clifford2017.rst
│ │ │ ├── config.rst
│ │ │ ├── fockstate.rst
│ │ │ ├── fs_utils.rst
│ │ │ ├── index.rst
│ │ │ ├── permanent.rst
│ │ │ ├── postselect.rst
│ │ │ ├── slap.rst
│ │ │ ├── slos.rst
│ │ │ ├── source.rst
│ │ │ ├── state_data_structure.rst
│ │ │ └── statevector.rst
│ │ ├── providers.rst
│ │ ├── rendering/
│ │ │ ├── display_config.rst
│ │ │ ├── index.rst
│ │ │ ├── pdisplay.rst
│ │ │ └── skins.rst
│ │ ├── runtime/
│ │ │ ├── index.rst
│ │ │ ├── job.rst
│ │ │ ├── job_group.rst
│ │ │ ├── job_status.rst
│ │ │ ├── remote_config.rst
│ │ │ ├── remote_processor.rst
│ │ │ └── rpchandler.rst
│ │ ├── serialization.rst
│ │ ├── simulators/
│ │ │ ├── ff_simulator.rst
│ │ │ ├── index.rst
│ │ │ ├── noisy_sampling_simulator.rst
│ │ │ ├── simulator.rst
│ │ │ ├── simulator_factory.rst
│ │ │ └── stepper.rst
│ │ ├── utils/
│ │ │ ├── conversion.rst
│ │ │ ├── density_matrix.rst
│ │ │ ├── dist_metrics.rst
│ │ │ ├── distinct_permutations.rst
│ │ │ ├── expression.rst
│ │ │ ├── index.rst
│ │ │ ├── logging.rst
│ │ │ ├── logical_state.rst
│ │ │ ├── matrix.rst
│ │ │ ├── noise_model.rst
│ │ │ ├── parameter.rst
│ │ │ ├── persistent_data.rst
│ │ │ ├── polarization.rst
│ │ │ ├── random_seed.rst
│ │ │ ├── stategenerator.rst
│ │ │ └── states.rst
│ │ └── utils_algorithms/
│ │ ├── circuit_optimizer.rst
│ │ ├── index.rst
│ │ └── simplify.rst
│ ├── references.bib
│ ├── tutorial_advanced.rst
│ ├── tutorial_beginner.rst
│ └── tutorial_expert.rst
├── perceval/
│ ├── __init__.py
│ ├── algorithm/
│ │ ├── __init__.py
│ │ ├── abstract_algorithm.py
│ │ ├── analyzer.py
│ │ ├── sampler.py
│ │ └── tomography/
│ │ ├── __init__.py
│ │ ├── abstract_process_tomography.py
│ │ ├── tomography.py
│ │ ├── tomography_mle.py
│ │ └── tomography_utils.py
│ ├── backends/
│ │ ├── __init__.py
│ │ ├── _abstract_backends.py
│ │ ├── _clifford2017.py
│ │ ├── _mps.py
│ │ ├── _naive.py
│ │ ├── _naive_approx.py
│ │ ├── _slap.py
│ │ └── _slos.py
│ ├── components/
│ │ ├── __init__.py
│ │ ├── _decompose_perms.py
│ │ ├── _mode_connector.py
│ │ ├── _pauli.py
│ │ ├── abstract_component.py
│ │ ├── abstract_processor.py
│ │ ├── compiled_circuit.py
│ │ ├── component_catalog.py
│ │ ├── core_catalog/
│ │ │ ├── __init__.py
│ │ │ ├── _helpers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── entanglement_qloq.py
│ │ │ │ └── rotations_qloq.py
│ │ │ ├── controlled_rotation_gates.py
│ │ │ ├── gates_1qubit.py
│ │ │ ├── generic_2mode.py
│ │ │ ├── heralded_cnot.py
│ │ │ ├── heralded_cz.py
│ │ │ ├── klm_cnot.py
│ │ │ ├── mzi.py
│ │ │ ├── postprocessed_ccz.py
│ │ │ ├── postprocessed_cnot.py
│ │ │ ├── postprocessed_cz.py
│ │ │ ├── qloq_ansatz.py
│ │ │ └── toffoli.py
│ │ ├── detector.py
│ │ ├── experiment.py
│ │ ├── feed_forward_configurator.py
│ │ ├── generic_interferometer.py
│ │ ├── linear_circuit.py
│ │ ├── non_unitary_components.py
│ │ ├── port.py
│ │ ├── processor.py
│ │ ├── source.py
│ │ ├── tomography_exp_configurer.py
│ │ └── unitary_components.py
│ ├── error_mitigation/
│ │ ├── __init__.py
│ │ ├── _loss_mitigation_utils.py
│ │ └── loss_mitigation.py
│ ├── providers/
│ │ ├── __init__.py
│ │ ├── quandela/
│ │ │ ├── __init__.py
│ │ │ └── quandela_session.py
│ │ └── scaleway/
│ │ ├── __init__.py
│ │ ├── scaleway_rpc_handler.py
│ │ └── scaleway_session.py
│ ├── rendering/
│ │ ├── __init__.py
│ │ ├── _density_matrix_utils.py
│ │ ├── _processor_utils.py
│ │ ├── canvas/
│ │ │ ├── __init__.py
│ │ │ ├── canvas.py
│ │ │ ├── latex_canvas.py
│ │ │ ├── mplot_canvas.py
│ │ │ └── svg_canvas.py
│ │ ├── circuit/
│ │ │ ├── __init__.py
│ │ │ ├── _canvas_shapes.py
│ │ │ ├── abstract_skin.py
│ │ │ ├── canvas_renderer.py
│ │ │ ├── create_renderer.py
│ │ │ ├── debug_skin.py
│ │ │ ├── display_config.py
│ │ │ ├── phys_skin.py
│ │ │ ├── renderer_interface.py
│ │ │ ├── skin_common.py
│ │ │ ├── symb_skin.py
│ │ │ └── text_renderer.py
│ │ ├── drawsvg_wrapper.py
│ │ ├── format.py
│ │ ├── mplotlib_renderers/
│ │ │ ├── __init__.py
│ │ │ ├── _mplot_utils.py
│ │ │ ├── density_matrix_renderer.py
│ │ │ ├── graph_renderer.py
│ │ │ └── tomography_renderer.py
│ │ └── pdisplay.py
│ ├── runtime/
│ │ ├── __init__.py
│ │ ├── check_cancel.py
│ │ ├── job.py
│ │ ├── job_group.py
│ │ ├── job_status.py
│ │ ├── local_job.py
│ │ ├── payload_generator.py
│ │ ├── remote_config.py
│ │ ├── remote_job.py
│ │ ├── remote_processor.py
│ │ ├── rpc_handler.py
│ │ └── session.py
│ ├── serialization/
│ │ ├── __init__.py
│ │ ├── _circuit_serialization.py
│ │ ├── _component_deserialization.py
│ │ ├── _constants.py
│ │ ├── _detector_serialization.py
│ │ ├── _experiment_serialization.py
│ │ ├── _matrix_serialization.py
│ │ ├── _parameter_serialization.py
│ │ ├── _port_deserialization.py
│ │ ├── _schema_circuit_pb2.py
│ │ ├── _serialized_containers.py
│ │ ├── _state_serialization.py
│ │ ├── deserialize.py
│ │ ├── perceval-serialization
│ │ ├── serialize.py
│ │ └── serialize_binary.py
│ ├── simulators/
│ │ ├── __init__.py
│ │ ├── _simulate_detectors.py
│ │ ├── _simulator_utils.py
│ │ ├── delay_simulator.py
│ │ ├── feed_forward_simulator.py
│ │ ├── loss_simulator.py
│ │ ├── noisy_sampling_simulator.py
│ │ ├── polarization_simulator.py
│ │ ├── simulator.py
│ │ ├── simulator_factory.py
│ │ ├── simulator_interface.py
│ │ └── stepper.py
│ └── utils/
│ ├── __init__.py
│ ├── _enums.py
│ ├── _random.py
│ ├── _validated_params.py
│ ├── algorithms/
│ │ ├── __init__.py
│ │ ├── circuit_optimizer.py
│ │ ├── decomposition.py
│ │ ├── match.py
│ │ ├── norm.py
│ │ ├── optimize.py
│ │ ├── simplification.py
│ │ └── solve.py
│ ├── conversion.py
│ ├── density_matrix.py
│ ├── density_matrix_utils.py
│ ├── dist_metrics.py
│ ├── format.py
│ ├── globals.py
│ ├── logging/
│ │ ├── __init__.py
│ │ ├── config.py
│ │ └── loggers.py
│ ├── logical_state.py
│ ├── matrix.py
│ ├── mlstr.py
│ ├── noise_model.py
│ ├── parameter.py
│ ├── persistent_data.py
│ ├── polarization.py
│ ├── postselect.py
│ ├── progress_cb.py
│ ├── qmath.py
│ ├── stategenerator.py
│ ├── states.py
│ └── versions/
│ ├── __init__.py
│ ├── metadata.py
│ └── version_utils.py
├── pyproject.toml
├── pytest.ini
├── requirements.txt
├── setup.py
└── tests/
├── __init__.py
├── _test_utils.py
├── algorithm/
│ ├── __init__.py
│ ├── test_analyzer.py
│ ├── test_sampler.py
│ ├── test_tomography.py
│ └── test_tomography_mle.py
├── backends/
│ ├── __init__.py
│ └── test_backends.py
├── components/
│ ├── __init__.py
│ ├── catalog/
│ │ ├── __init__.py
│ │ ├── test_1_qubit_gates.py
│ │ ├── test_2qbits_gates.py
│ │ ├── test_pauli.py
│ │ └── test_qloq.py
│ ├── test_circuit.py
│ ├── test_compiled_circuit.py
│ ├── test_compute_unitary.py
│ ├── test_controlled_gates.py
│ ├── test_decomposition.py
│ ├── test_detectors.py
│ ├── test_ff_configurator.py
│ ├── test_generic_interferometer.py
│ ├── test_loss_channel.py
│ ├── test_match.py
│ ├── test_mode_connector.py
│ ├── test_permutation.py
│ ├── test_port.py
│ ├── test_processor.py
│ ├── test_processor_composition.py
│ ├── test_source.py
│ ├── test_time_delay.py
│ ├── test_transfer.py
│ └── test_unitary_determinant.py
├── data/
│ ├── u_hom
│ ├── u_hom_sym
│ ├── u_random_2
│ ├── u_random_3
│ └── u_random_8
├── error_mitigation/
│ ├── __init__.py
│ └── test_loss_mitigation.py
├── rendering/
│ ├── __init__.py
│ ├── test_rendering.py
│ ├── test_visualization.py
│ └── test_visualization_ide.py
├── requirements.txt
├── runtime/
│ ├── __init__.py
│ ├── _mock_rpc_handler.py
│ ├── test_job.py
│ ├── test_job_group.py
│ ├── test_payload_generation.py
│ ├── test_remote_config.py
│ ├── test_remote_job.py
│ ├── test_rpc_handler.py
│ └── test_shots_estimate.py
├── serialization/
│ ├── __init__.py
│ ├── test_serialization.py
│ └── test_serialized_containers.py
├── simulators/
│ ├── __init__.py
│ ├── test_delay_simulator.py
│ ├── test_ff_simulator.py
│ ├── test_loss_simulator.py
│ ├── test_noisy_sampling_simulator.py
│ ├── test_polarization_simulator.py
│ ├── test_samples_provider.py
│ ├── test_simulate_detectors.py
│ ├── test_simulator.py
│ ├── test_simulator_factory.py
│ ├── test_simulator_utils.py
│ └── test_stepper.py
├── test_test_utils.py
└── utils/
├── __init__.py
├── test_circuit_optimizer.py
├── test_density_matrix.py
├── test_dist_metrics.py
├── test_doc_config.py
├── test_fidelity.py
├── test_format.py
├── test_log.py
├── test_logical_state.py
├── test_mask.py
├── test_matrix.py
├── test_metadata.py
├── test_mlstr.py
├── test_noise_model.py
├── test_optimize.py
├── test_parameter.py
├── test_persistent_data.py
├── test_polarization.py
├── test_postselect.py
├── test_qmath.py
├── test_seed.py
├── test_simplification.py
├── test_stategenerator.py
├── test_statevector.py
├── test_tensorproduct.py
└── test_utils_conversion.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Prerequisite**
Please ensure that this bug has not been answered on the [Perceval forum](https://perceval.quandela.net/forum)
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. macOS, Ubuntu]
- CPU Arch: [e.g. x86_64, Apple M1, ARMv7]
- Python Version: [e.g. 3.13]
- Perceval Version: [e.g. 0.3.3]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Prerequisite**
Please ensure this has not been requested on the [Perceval forum](https://perceval.quandela.net/forum)
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/rendering_requirements.txt
================================================
contourpy
cycler
drawsvg
fonttools
kiwisolver
latexcodec
matplotlib
pillow
pyparsing
python-dateutil
six
================================================
FILE: .github/workflows/autotests.yml
================================================
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Auto Tests
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
workflow_dispatch:
inputs:
python_v:
description: 'python version'
required: true
default: '3.11'
type: choice
options:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
env:
PYTHON_V: ${{ github.event.inputs.python_v || '3.11' }}
jobs:
perceval-autotests:
name: Run PyTest on ${{ matrix.os }}
if: always()
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- if: runner.os == 'Linux'
name: Initialize PYTHON_V_CP linux
run: |
echo "PYTHON_V_CP=cp$( echo '${{env.PYTHON_V}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
- if: runner.os != 'Linux'
name: Initialize PYTHON_V_CP notLinux
run: |
echo "PYTHON_V_CP=cp$( echo '${{env.PYTHON_V}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
shell: Bash
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_V }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_V }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r tests/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
perceval-lite-autotests:
name: Run PyTest with light install on ${{ matrix.os }}
if: always()
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- if: runner.os == 'Linux'
name: Initialize PYTHON_V_CP linux
run: |
echo "PYTHON_V_CP=cp$( echo '${{env.PYTHON_V}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
- if: runner.os != 'Linux'
name: Initialize PYTHON_V_CP notLinux
run: |
echo "PYTHON_V_CP=cp$( echo '${{env.PYTHON_V}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
shell: Bash
- uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_V }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_V }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r tests/requirements.txt
python -m pip uninstall -y -r .github/rendering_requirements.txt
- name: Test with pytest
run: |
pytest -m "not rendering"
perceval-docs-test:
name: Build docs on ubuntu
needs:
- perceval-autotests
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- if: runner.os == 'Linux'
name: Initialize PYTHON_V_CP linux
run: |
echo "PYTHON_V_CP=cp$( echo '${{env.PYTHON_V}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
- if: runner.os != 'Linux'
name: Initialize PYTHON_V_CP notLinux
run: |
echo "PYTHON_V_CP=cp$( echo '${{env.PYTHON_V}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
shell: Bash
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-tags: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_V }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt
python -m pip install .
- name: Install Pandoc
run: |
sudo apt update
sudo apt install pandoc
- name: Build docs
run: |
cd docs
make html
- name: 'Create docs Artefact'
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/build/html
retention-days: 1
================================================
FILE: .github/workflows/benchmarks.yml
================================================
# this is a manual workflow that compare benchmarks with the same runner and the same version of python
# choose runner, perceval ref, save data and log
# runs benchmarks at benchmarks/benchmark_*.py
name: Benchmarks
on:
workflow_dispatch:
inputs:
runner:
description: Runner
required: true
default: 'MiniMac_arm64'
type: choice
options:
- MiniMac_arm64
- ubuntu-latest
commit_ref:
description: Use specific perceval's ref (branch, tag or SHA)
default: ''
type: string
required: false
save:
description: save in the current github repository
default: false
required: false
type: boolean
gh_branch:
description: Use specific branch for save graph
default: 'main'
type: string
required: false
jobs:
setup:
runs-on: ubuntu-latest
outputs:
save: ${{ steps.step1.outputs.save }}
runner: ${{ steps.step1.outputs.runner }}
os: ${{ steps.step1.outputs.os }}
commit_ref: ${{ steps.step1.outputs.commit_ref }}
python_v: ${{ steps.step1.outputs.python_v }}
python_v_cp: ${{ steps.step1.outputs.python_v_cp }}
folder_env: ${{ steps.step1.outputs.folder_env }}
folder_file_json: ${{ steps.step1.outputs.folder_file_json }}
gh_branch: ${{ steps.step1.outputs.gh_branch }}
steps:
- name: Check branch
id: step1
run: |
echo "save=${{ github.event.inputs.save == null || github.event.inputs.save }}" >> $GITHUB_OUTPUT
echo "runner=${{ github.event.inputs.runner || 'MiniMac_arm64' }}" >> $GITHUB_OUTPUT
if [ ${{ github.event.inputs.runner }} == 'ubuntu-latest' ]; then
echo "os=ubuntu-latest" >> $GITHUB_OUTPUT
else
echo "os=macos-latest" >> $GITHUB_OUTPUT
fi
echo "commit_ref=${{ github.event.inputs.commit_ref || '' }}" >> $GITHUB_OUTPUT
echo "python_v=${{ github.event.inputs.python_v || '3.11' }}" >> $GITHUB_OUTPUT
echo "python_v_cp=cp$( echo '${{github.event.inputs.python_v || '3.11'}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_OUTPUT
echo "folder_env=${{ github.event.inputs.os || 'MiniMac_arm64' }}-CPython-${{ github.event.inputs.python_v || '3.11' }}" >> $GITHUB_OUTPUT
echo "folder_file_json=.benchmarks/${{ github.event.inputs.os || 'MiniMac_arm64' }}-CPython-${{ github.event.inputs.python_v || '3.11' }}/log/${{ github.run_number }}_$( git describe --tags )_${{ github.sha }}.json" >> $GITHUB_OUTPUT
echo "gh_branch=${{ github.event.inputs.gh_branch || 'main' }}" >> $GITHUB_OUTPUT
benchmark:
name: Run pytest-benchmark benchmark example
if: ${{ always() }}
needs:
- setup
runs-on: ${{ needs.setup.outputs.runner }}
steps:
- name: checkout on perceval's ref
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.commit_ref }}
fetch-depth: 0
# install python, already DL on MiniMac_arm64
- if: ${{ needs.setup.outputs.runner != 'MiniMac_arm64' }}
name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ needs.setup.outputs.python_v }}
- name: setup virtual env
uses: syphar/restore-virtualenv@v1
id: cache-virtualenv
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r tests/requirements.txt
- name: Run benchmark
run: |
python -m pytest benchmark/benchmark_*.py --benchmark-json out.json --benchmark-storage file://./.benchmarks/${{ needs.setup.outputs.folder_env }}/log/
mv out.json ${{ needs.setup.outputs.folder_file_json }}
# upload the result on action GitHub
- name: upload the log result
uses: actions/upload-artifact@v4
with:
name: pytest_benchmarks_log_${{ needs.setup.outputs.folder_env }}_${{ github.run_number }}
path: ${{ needs.setup.outputs.folder_file_json }}
- name: checkout in Initial commit to avoid bug
uses: actions/checkout@v4
with:
ref: 217f0c716956da75eac217e9bc089f881bd5a2aa
- name: Download the log result
uses: actions/download-artifact@v3
with:
name: pytest_benchmarks_log_${{ needs.setup.outputs.folder_env }}_${{ github.run_number }}
path: .benchmarks/${{ needs.setup.outputs.folder_env }}/log
# use github-action-benchmark for graph
- if: ${{ needs.setup.outputs.save == 'true' }}
name: create a graph and save on current repo
uses: benchmark-action/github-action-benchmark@v1
with:
name: Automated benchmarks report
tool: 'pytest'
output-file-path: ${{ needs.setup.outputs.folder_file_json }}
benchmark-data-dir-path: .benchmarks/${{ needs.setup.outputs.folder_env }}
gh-pages-branch: ${{ needs.setup.outputs.gh_branch }}
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
alert-threshold: '120%'
comment-on-alert: true
- if: ${{ github.event_name == 'workflow_dispatch' && needs.setup.outputs.save == 'false' }}
name: create a graph and save on private repo
uses: benchmark-action/github-action-benchmark@v1
with:
name: Automated benchmarks report
tool: 'pytest'
output-file-path: ${{ needs.setup.outputs.folder_file_json }}
benchmark-data-dir-path: .benchmarks/${{ needs.setup.outputs.folder_env }}
gh-pages-branch: ${{ needs.setup.outputs.gh_branch }}
github-token: ${{ secrets.PERCEVAL_BENCHMARK_TOKEN }}
gh-repository: 'github.com/Quandela/Perceval-PrivateBenchmark'
auto-push: true
alert-threshold: '120%'
comment-on-alert: true
- uses: actions/checkout@v4
with:
repository: Quandela/Perceval-PrivateBenchmark
ref: ${{ needs.setup.outputs.gh_branch }}
path: Perceval-PrivateBenchmark
token: ${{ secrets.PERCEVAL_BENCHMARK_TOKEN }}
submodules: recursive
fetch-depth: 0
- name: upload the log result
uses: actions/upload-artifact@v4
with:
name: benchmarks_graph
path: Perceval-PrivateBenchmark/.benchmarks/${{ needs.setup.outputs.folder_env }}/
- name: Download the log result
uses: actions/download-artifact@v3
with:
name: benchmarks_graph
path: Perceval-PrivateBenchmark/.benchmarks/${{ needs.setup.outputs.folder_env }}/
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PERCEVAL_WEB_SSHKEY }}
known_hosts: ${{ secrets.PERCEVAL_WEB_KNOWN_HOST }}
- name: Deploy
run: rsync -avz Perceval-PrivateBenchmark/.benchmarks/${{ needs.setup.outputs.folder_env }}/ ${{secrets.PERCEVAL_WEB_USER}}@${{secrets.PERCEVAL_WEB_HOST}}:/var/www/html-benchmark
================================================
FILE: .github/workflows/build-and-deploy-docs.yml
================================================
# This is a basic workflow that is manually triggered
name: Build and deploy docs
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
release:
types: [published]
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy-docs:
name: Build and deploy docs to website
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt
python -m pip install .
- name: Install Pandoc
run: |
sudo apt update
sudo apt install pandoc
- name: Build docs
run: |
cd docs
make multiversion
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.PERCEVAL_WEB_SSHKEY }}
known_hosts: ${{ secrets.PERCEVAL_WEB_KNOWN_HOST }}
- name: Deploy
run: rsync -avz --delete docs/build/html/ ${{secrets.PERCEVAL_WEB_USER}}@${{secrets.PERCEVAL_WEB_HOST}}:/var/www/html-perceval
================================================
FILE: .github/workflows/python-publish.yml
================================================
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Deploy to PyPi
on:
release:
types: [published]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel scmver setuptools
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
================================================
FILE: .github/workflows/rerun-notebooks-and-build-docs.yml
================================================
# This is a basic workflow that is manually triggered
name: Rerun notebooks and build docs
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
pull_request:
branches:
- main
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
perceval-extensive-autotests:
name: Run PyTest on ${{ matrix.os }} and with python version ${{ matrix.version }}
if: always()
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
version: ['3.10', '3.14'] # only running with oldest and newest version
steps:
- if: runner.os == 'Linux'
name: Initialize PYTHON_V_CP linux
run: |
echo "PYTHON_V_CP=cp$( echo '${{matrix.version}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
- if: runner.os != 'Linux'
name: Initialize PYTHON_V_CP notLinux
run: |
echo "PYTHON_V_CP=cp$( echo '${{matrix.version}}' | sed 's/\.\([0-9]\)/\1/' )" >> $GITHUB_ENV
shell: Bash
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r tests/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
build-env:
name: Rerun notebooks and build docs
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
# Documentation needs 3.11 to be built
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r docs/requirements.txt -r docs/source/notebooks/requirements.txt
- name: Rerun notebooks
run: |
./.github/workflows/rerun_notebooks.sh
- name: Install Pandoc
run: |
sudo apt update
sudo apt install pandoc
- name: Build docs
run: |
cd docs
make multiversion
- name: 'Create docs Artefact'
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/build/html
retention-days: 1
================================================
FILE: .github/workflows/rerun_notebooks.sh
================================================
my_function () {
echo converting $notebook
jupyter nbconvert --clear-output --inplace "$notebook"
jupyter nbconvert --execute --to notebook --inplace "$notebook"
jupyter nbconvert --ClearMetadataPreprocessor.enabled=True --inplace "$notebook"
}
nb_dir="docs/source/notebooks"
for entry in `ls $nb_dir | grep \.ipynb`; do
notebook=$nb_dir/$entry
if [[ $notebook =~ ".ipynb" ]]
then
if [ "$notebook" = "docs/source/notebooks/BS-based_implementation.ipynb" ]
then
echo $notebook is ignore
elif [ "$notebook" = "docs/source/notebooks/Boson_sampling.ipynb" ]
then
echo $notebook is ignore
elif [ "$notebook" = "docs/source/notebooks/Gedik_qudit.ipynb" ]
then
echo $notebook is ignore
elif [ "$notebook" = "docs/source/notebooks/Remote_Computation_Tutorial.ipynb" ]
then
echo $notebook is ignore
else
my_function
fi
fi
done
================================================
FILE: .gitignore
================================================
.pytest_cache
__pycache__
perceval_quandela.egg-info
build
.eggs/
dist/
.idea/
venv*
*.whl
.ipynb_checkpoints/
.coverage
.vscode*
.venv
================================================
FILE: .pre-commit-config.yaml
================================================
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
hooks:
- id: forbid-crlf
types: ["file", "python", "text"]
- id: remove-crlf
types: ["file", "python", "text"]
- id: forbid-tabs
types: ["file", "python", "text"]
- id: remove-tabs
types: ["file", "python", "text"]
- id: insert-license
types: ["file", "python", "text"]
args:
- --license-filepath
- LICENSE
- repo: local
hooks:
- id: jupyter-nb-clear-metadata
name: jupyter-nb-clear-metadata
files: \.ipynb$
stages: [pre-commit]
language: python
entry: jupyter nbconvert --ClearMetadataPreprocessor.enabled=True --inplace
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
perceval.oss@quandela.com.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing
*Thanks for being there!*
There are many ways you can help in the Perceval project. This document will guide you through this process.
## Reporting issues
We use GitHub issues for bugs in the code that are **reproducible**. A good bug report should contain every information
needed to reproduce it. Before opening a new issue, make sure to:
* **use the GitHub issue search** for existing and fixed bugs;
* **check if the issue has been fixed** in a more recent version;
* **isolate the problem** to give as much context as possible.
If you have questions on how to use the project or have trouble getting started with it,
consider using [our forum](https://perceval.quandela.net/forum/) instead.
## Requesting features
Do you think a feature is missing or would be a great addition to the project? Please open a GitHub issue to describe it.
## Contributing to the documentation
We would like the documentation to be as complete as possible, providing details about the framework, but
also about the field - and serve as a fully consistent training material. From our experience, documentation is never
an achieved task - and feel free to contribute - all the documentation is part of the project in
https://github.com/Quandela/Perceval/source.
## Developing code
*You want to share some code, that's great!*
* If you want to contribute with code but are unsure what to do,
* search for *TODO* comments in the code: these are small dev tasks that should be addressed at some point.
* look for GitHub issues marked with the *help wanted* label: these are developments that we find particularly suited for community contributions.
* If you are planning to make a large change to the existing code, consider asking first on [the forum](https://perceval.quandela.net/forum/) to confirm that it is welcome.
In any cases, your new code **must**:
* pass the existing tests
* pass the [`flake8`](https://flake8.pycqa.org/en/latest/) style checker
and **should**:
* add new tests
→ you can use the coverage report to help you find untested code (see [README](README.md#running-tests-and-benchmarks) )
* update the [documentation](docs/source/)
## Helping others
Sharing experiences on the [forum](https://perceval.quandela.net/forum/), or contributing to open discussions will be
highly appreciated!
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2022 Quandela
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
As a special exception, the copyright holders of exqalibur library give you
permission to combine exqalibur with code included in the standard release of
Perceval under the MIT license (or modified versions of such code). You may
copy and distribute such a combined system following the terms of the MIT
license for both exqalibur and Perceval. This exception for the usage of
exqalibur is limited to the python bindings used by Perceval.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
[](https://github.com/Quandela/Perceval/releases/latest)

[](https://github.com/Quandela/Perceval/actions/workflows/python-publish.yml)
[](https://github.com/Quandela/Perceval/actions/workflows/autotests.yml)
[](https://github.com/Quandela/Perceval/actions/workflows/build-and-deploy-docs.ym)
# Perceval <a href="https://perceval.quandela.net" target="_blank"> <img src="logo-perceval.png" width="50" height="50"> </a>
Through a simple object-oriented python API, Perceval provides tools for building a circuit with linear optics components,
defining single-photon sources and their error model, manipulating Fock states, running simulations, reproducing published experimental papers results,
and experimenting with a new generation of quantum algorithms.
It is interfaced with the available QPUs on
the [Quandela cloud](https://cloud.quandela.com/webide/), so it is possible to run computations on an
actual photonic computer.
Perceval aims to be a companion tool for developing discrete-variable photonics circuits
- while simulating their design, modelling their ideal and real-life behaviour;
- and proposing a normalized interface to control photonic quantum computers;
- while using powerful simulation backends to get state-of-the-art simulation;
- and also allowing direct access to the QPUs of Quandela.
Perceval has been developed as a complete toolkit for physicists and quantum computational students, researchers and
practitioners.
# Key Features
* Powerful Circuit designer making use of predefined components
* Simple python API and powerful simulation backends optimized in C
* Misc technical utilities to manipulate State Vector, Unitary Matrices, and circuit Parameters
* Transversal tools for visualization compatible with notebooks or local development environments
* Numerical and symbolical computation
* Modular architecture welcoming contributions from the community
# Installation
Perceval requires:
* Python between 3.10 and 3.14
## PIP
We recommend installing it with `pip`:
```bash
pip install --upgrade pip
pip install perceval-quandela
```
Our qiskit, qutip, cqasm or myqlm bridges have been moved to a separate
interoperability package `perceval-interop` (https://perceval.quandela.net/interopdocs/).
## GitHub
```bash
git clone https://github.com/quandela/Perceval
```
then to install Perceval:
```bash
pip install .
```
Or for developers:
```bash
pip install -e .
```
# Running tests and benchmarks
Unit tests files are part of the repository in `tests/` and can be run with:
```
pip install -r tests/requirements.txt
pytest
```
Additionally, you can see a coverage report with the command:
```
pytest --cov=perceval
```
Benchmark tests for computing-intensive functions are in `benchmark/` and can be run with:
```
pytest benchmark/benchmark_*.py
```
Comparison benchmarks for different platforms are also committed in `.benchmarks/` - see [pytest-benchmark documentation](https://pytest-benchmark.readthedocs.io/en/stable/usage.html) for more information.
# Documentation and Forum
* The [documentation](https://perceval.quandela.net/docs)
* The [Community Forum](https://perceval.quandela.net/forum)
#
[<img src="logo-quandela.png" width="300" height=auto>](https://www.quandela.com/)
[](https://twitter.com/Quandela_SAS)
[](https://www.youtube.com/channel/UCl5YMpSqknJ1n-IT-XWfLsQ)
================================================
FILE: benchmark/benchmark-circuit-building.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import perceval as pcvl
from perceval.components.unitary_components import BS, PS, PERM
import random
import time
t_build = 0
t_set = 0
t_compute = 0
t_get = 0
for _ in range(1000):
start = time.time()
#List of the parameters φ1,φ2,...,φ8
List_Parameters = []
# VQE is a 6 optical mode circuit
VQE = pcvl.Circuit(6)
VQE.add((1, 2), BS.H())
VQE.add((3, 4), BS.H())
List_Parameters.append(pcvl.Parameter("φ1"))
VQE.add((2,), PS(phi=List_Parameters[-1]))
List_Parameters.append(pcvl.Parameter("φ3"))
VQE.add((4,), PS(phi=List_Parameters[-1]))
VQE.add((1, 2), BS.H())
VQE.add((3, 4), BS.H())
List_Parameters.append(pcvl.Parameter("φ2"))
VQE.add((2,), PS(phi=List_Parameters[-1]))
List_Parameters.append(pcvl.Parameter("φ4"))
VQE.add((4,), PS(phi=List_Parameters[-1]))
# CNOT ( Post-selected with a success probability of 1/9)
VQE.add([0,1,2,3,4,5], PERM([0,1,2,3,4,5]))#Identity PERM (permutation) for the purpose of drawing a nice circuit
VQE.add((3, 4), BS.H())
VQE.add([0,1,2,3,4,5], PERM([0,1,2,3,4,5]))#Identity PERM (permutation) for the same purpose
VQE.add((0, 1), BS.H(theta=BS.r_to_theta(1/3)))
VQE.add((2, 3), BS.H(theta=BS.r_to_theta(1/3)))
VQE.add((4, 5), BS.H(theta=BS.r_to_theta(1/3)))
VQE.add([0,1,2,3,4,5], PERM([0,1,2,3,4,5]))#Identity PERM (permutation) for the same purpose
VQE.add((3, 4), BS.H())
VQE.add([0,1,2,3,4,5], PERM([0,1,2,3,4,5]))#Identity PERM (permutation) for the same purpose
List_Parameters.append(pcvl.Parameter("φ5"))
VQE.add((2,), PS(phi=List_Parameters[-1]))
List_Parameters.append(pcvl.Parameter("φ7"))
VQE.add((4,), PS(phi=List_Parameters[-1]))
VQE.add((1, 2), BS.H())
VQE.add((3, 4), BS.H())
List_Parameters.append(pcvl.Parameter("φ6"))
VQE.add((2,), PS(phi=List_Parameters[-1]))
List_Parameters.append(pcvl.Parameter("φ8"))
VQE.add((4,), PS(phi=List_Parameters[-1]))
VQE.add((1, 2), BS.H())
VQE.add((3, 4), BS.H())
t_build += time.time()-start
start = time.time()
init_param = [random.random() for _ in List_Parameters]
for idx, p in enumerate(List_Parameters):
p.set_value(init_param[idx])
t_set += time.time()-start
start = time.time()
VQE.compute_unitary(use_symbolic = False)
t_compute += time.time()-start
start = time.time()
for i in range(len(List_Parameters)):
init_param[i] = VQE.get_parameters()[i]._value
t_get += time.time()-start
print("TOTAL=", t_build+t_set+t_compute+t_get, "DETAIL=", t_build, t_set, t_compute, t_get)
================================================
FILE: benchmark/benchmark-unitary.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
r"""
This script compares building of unitary when using Circuit or directly by building matrix.
"""
import perceval as pcvl
import perceval.components.unitary_components as comp
import time
import numpy as np
m = 8
def phase_shift(n_mode, theta):
# phase shift in m x m unitary in mode 1 of angle theta
ps_matrix = np.eye(n_mode, dtype=complex)
ps_matrix[0, 0] = np.cos(theta) + 1j * np.sin(theta)
return ps_matrix
u1 = pcvl.Matrix.random_unitary(m)
u2 = pcvl.Matrix.random_unitary(m)
px = pcvl.P("x")
c = comp.Unitary(u2) // (0, comp.PS(px)) // comp.Unitary(u1)
dt_circuit = 0
dt_raw = 0
for _ in range(1000):
top0 = time.time_ns()
px.set_value(1)
c.compute_unitary(use_symbolic=False)
top1 = time.time_ns()
dt_circuit += top1-top0
top0 = time.time_ns()
U = u1 @ phase_shift(m, 1) @ u2
top1 = time.time_ns()
dt_raw += top1-top0
if dt_circuit/dt_raw > 2.5:
print("TOO_SLOW", "circuit", dt_circuit, "raw", dt_raw, "factor", dt_circuit/dt_raw)
else:
print("OK", "circuit", dt_circuit, "raw", dt_raw, "factor", dt_circuit/dt_raw)
================================================
FILE: benchmark/benchmark_QML-DE-solver.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import random
import perceval as pcvl
import perceval.components.unitary_components as comp
import numpy as np
from math import comb
from scipy.optimize import minimize
# Differential equation parameters
lambd = 8
kappa = 0.1
def F(u_prime, u, x): # DE: F(u_prime, u, x) = 0
# Must work with numpy arrays
return (u_prime + lambd * u * (kappa + np.tan(lambd * x)))
# Boundary condition (f(x_0)=f_0)
x_0 = 0
f_0 = 1
# Modeling parameters
n_grid = 50 # number of grid points of the discretized differential equation
range_min = 0 # minimum of the interval on which we wish to approximate our function
range_max = 1 # maximum of the interval on which we wish to approximate our function
X = np.linspace(range_min, range_max, n_grid) # Optimisation grid
# Parameters of the quantum machine learning procedure
eta = 5 # weight granted to the initial condition
a = 200 # Approximate boundaries of the interval that the image of the trial function can cover
N = m = 6
N2 = N ** 2
input_state = pcvl.BasicState([1] * N + [0] * (m - N))
s1 = pcvl.SLOSBackend()
s1.set_circuit(pcvl.Unitary(pcvl.Matrix.random_unitary(m)))
s1.preprocess([input_state])
random.seed(0)
np.random.seed(0)
pcvl.random_seed(0)
fock_dim = comb(N + m - 1, N)
lambda_random = np.random.rand(fock_dim)
lambda_random = a * (lambda_random - np.mean(lambda_random)) / np.std(lambda_random)
dx = (range_max - range_min) / (n_grid - 1)
parameters = np.random.normal(size=4 * N2)
def calc(circuit, input_state, coefs):
s1.set_circuit(circuit)
probs = s1.all_prob(input_state)
return np.sum(np.multiply(probs, coefs))
def computation(params):
"""compute the loss function of a given differential equation in order for it to be optimized"""
coefs = lambda_random # coefficients of the M observable
# initial condition with the two universal interferometers and the phase shift in the middle
U_1 = pcvl.Matrix.parametrized_unitary(N, params[:2 * N2])
U_2 = pcvl.Matrix.parametrized_unitary(N, params[2 * N2:4 * N2])
# Circuit creation
px = pcvl.P("px")
c = (comp.Unitary(U_2)
// (0, comp.PS(px))
// comp.Unitary(U_1))
px.set_value(x_0)
f_theta_0 = calc(c, input_state, coefs)
# boundary condition given a weight eta
loss = eta * (f_theta_0 - f_0) ** 2 * n_grid
# Warning : Y[0] is before the domain we are interested in (used for differentiation), the domain begins at Y[1]
Y = np.zeros(n_grid + 2)
# Small optimisation working if x_0 == range_min
if x_0 == range_min:
Y[1] = f_theta_0
assigned = 1
else:
assigned = 0
px.set_value(range_min - dx)
Y[0] = calc(c, input_state, coefs)
for i in range(assigned, n_grid):
x = X[i]
px.set_value(x)
Y[i + 1] = calc(c, input_state, coefs)
# Y_prime[0] is the beginning of the domain /!\ not the same for Y
px.set_value(range_max + dx)
Y[n_grid + 1] = calc(c, input_state, coefs)
Y_prime = (Y[2:] - Y[:-2]) / (2 * dx)
# This method is apparently the fastest to calculate the L2 norm squared
loss += np.sum((F(Y_prime, Y[1:-1], X)) ** 2)
current_loss = loss / n_grid
return current_loss
def test_QML_DE_solver(benchmark):
benchmark(minimize, computation, parameters,
method='BFGS', options={'gtol': 1E-2})
================================================
FILE: benchmark/benchmark_bosonsampling.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import math
import perceval as pcvl
from perceval.components.unitary_components import BS, PS, Unitary
def get_interferometer(n):
def _gen_mzi(i: int):
return pcvl.catalog["mzi phase last"].build_circuit(theta_a=0.42, theta_b=0.42,
phi_a=math.pi+i*0.1, phi_b=math.pi/2)
return pcvl.GenericInterferometer(n, _gen_mzi)
def simulate_sampling(shots, circuit, input_state):
clifford = pcvl.Clifford2017Backend()
clifford.set_circuit(circuit)
clifford.set_input_state(input_state)
for i in range(shots):
clifford.sample()
def test_bosonsampling_clifford_6(benchmark):
benchmark(simulate_sampling, shots=100,
circuit=get_interferometer(6), input_state=pcvl.BasicState([1] * 6))
def test_bosonsampling_clifford_8(benchmark):
benchmark(simulate_sampling, shots=20,
circuit=get_interferometer(8), input_state=pcvl.BasicState([1] * 8))
================================================
FILE: benchmark/benchmark_pdisplay.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
r"""
This script times the execution of pdisplay for circuits.
"""
import perceval as pcvl
import perceval.components.unitary_components as comp
trials = 2
def generate_circuit(n_mode):
u = pcvl.Matrix.random_unitary(n_mode)
mzi = (pcvl.Circuit(2)
// comp.BS()
// (0, comp.PS(phi=pcvl.P("φ_a")))
// comp.BS()
// (0, comp.PS(phi=pcvl.P("φ_b"))))
return pcvl.Circuit.decomposition(u, mzi, shape=pcvl.InterferometerShape.TRIANGLE)
c6 = generate_circuit(6)
c12 = generate_circuit(12)
def run_pdisplay(c, t, f):
for _ in range(t):
pcvl.pdisplay(c, output_format=f, mplot_noshow=True)
def _run_pdisplay_mplot_6():
run_pdisplay(c6, trials, pcvl.Format.MPLOT)
def _run_pdisplay_mplot_12():
run_pdisplay(c12, trials, pcvl.Format.MPLOT)
def _run_pdisplay_svg_6():
run_pdisplay(c6, trials, pcvl.Format.HTML)
def _run_pdisplay_svg_12():
run_pdisplay(c12, trials, pcvl.Format.HTML)
def test_pdisplay_mplot_6(benchmark):
benchmark(_run_pdisplay_mplot_6)
def test_pdisplay_mplot_12(benchmark):
benchmark(_run_pdisplay_mplot_12)
def test_pdisplay_svg_6(benchmark):
benchmark(_run_pdisplay_svg_6)
def test_pdisplay_svg_12(benchmark):
benchmark(_run_pdisplay_svg_12)
================================================
FILE: benchmark/benchmark_stepper.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import random
import perceval as pcvl
from perceval.backends import SLOSBackend, NaiveBackend
from perceval.simulators import Stepper
from perceval.components import BS, PS
from perceval.utils import BasicState
# definition of the circuit
C = pcvl.Circuit(2)
C.add((0, 1), BS())
C.add(1, PS(1))
C.add((0, 1), BS())
N = 100
def get_sample_from_statevector(sv):
p = random.random()
state = None
for state, pa in sv:
proba = abs(pa)**2
if p > proba:
p -= proba
continue
break
return state
def run_stepper():
samples = []
stepper = Stepper(SLOSBackend())
stepper.set_circuit(C)
for i in range(N):
sv = pcvl.StateVector(pcvl.BasicState([1, 0]))
for r, c in C:
sv = stepper.apply(sv, r, c)
samples.append(get_sample_from_statevector(sv))
return samples
def run_direct():
bs = C._components[0][1]
sim_bs = NaiveBackend()
sim_bs.set_circuit(bs)
ps = C._components[1][1]
sim_ps = NaiveBackend()
sim_ps.set_circuit(ps)
samples = []
bs10 = BasicState([1,0])
bs01 = BasicState([0,1])
for i in range(N):
# apply first bs
sim_bs.set_input_state(bs10)
sv_a0 = sim_bs.prob_amplitude(bs10)
sv_a1 = sim_bs.prob_amplitude(bs01)
# apply ps
sv_b0 = sv_a0
sim_ps.set_input_state(BasicState([1]))
sv_b1 = sv_a1*sim_ps.prob_amplitude(BasicState([1]))
# apply second bs
sv_c0 = sv_b0*sim_bs.prob_amplitude(bs10)
sv_c1 = sv_b0*sim_bs.prob_amplitude(bs01)
sim_bs.set_input_state(bs01)
sv_c0 += sv_b1*sim_bs.prob_amplitude(bs10)
sv_c1 += sv_b1*sim_bs.prob_amplitude(bs01)
# sampling from there
samples.append(bs10 if random.random() > abs(sv_c0)**2 else bs01)
return samples
def test_stepper(benchmark):
benchmark(run_stepper)
def test_stepper_comp_direct(benchmark):
benchmark(run_direct)
================================================
FILE: conftest.py
================================================
import pytest
def pytest_addoption(parser):
parser.addoption("--skip-long-test", action="store_true",
help="do not run long tests")
parser.addoption("--save_figs", action="store_true",
help="use to generate new test figures")
def pytest_runtest_setup(item):
if 'long_test' in item.keywords and item.config.getoption("--skip-long-test"):
pytest.skip("ignored per user request")
================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
multiversion:
python -m sphinx_multiversion -f multiversion_config source build/html
clean:
rm -rf build
.PHONY: clean
================================================
FILE: docs/make.bat
================================================
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd
================================================
FILE: docs/multiversion_config/conf.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import re
from pathlib import Path
from git import Repo
from perceval.utils.versions.version_utils import keep_latest_versions
sys.path.insert(0, os.path.relpath("../"))
REPO_PATH = Path(__file__).parent.parent.parent.resolve()
repo = Repo(REPO_PATH)
tags = [tag.name for tag in repo.tags]
versions = keep_latest_versions(tags, "v0.6")
versions_string = "|".join([f"({one_version})" for one_version in versions])
versions_regex = re.compile(f"^{versions_string}$")
print(f"Building {versions_regex}")
# Whitelist pattern for tags (set to None to ignore all tags)
smv_tag_whitelist = versions_regex
# Whitelist pattern for branches (set to None to ignore all branches)
smv_branch_whitelist = None
# Whitelist pattern for remotes (set to None to use local branches only)
smv_remote_whitelist = None
# Pattern for released versions
smv_released_pattern = r".*"
smv_regex_name = r"(.*)\..*"
================================================
FILE: docs/requirements.txt
================================================
wheel
sphinx==6.2.1
sphinx_rtd_theme
sphinxcontrib-bibtex
sphinx_autodoc_typehints
enum-tools[sphinx]
nbsphinx
jinja2==3.0.0
ipython
ipykernel
gitpython
git+https://github.com/Quandela/sphinx-multiversion-contrib.git@1.1.1
================================================
FILE: docs/source/_static/css/style.css
================================================
@import url("theme.css");
.wy-nav-content {
max-width: 1200px !important;
}
================================================
FILE: docs/source/_templates/layout.html
================================================
{% extends "!layout.html" %}
{% block extrahead %}
{{ super() }}
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TB3VSRKZ');</script>
<!-- End Google Tag Manager -->
{% endblock %}
{% block extrabody %}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TB3VSRKZ"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{{ super() }}
{% endblock %}
================================================
FILE: docs/source/_templates/page.html
================================================
{% extends "!page.html" %} {% block body %} {% if current_version and
latest_version and current_version != latest_version %}
<p style="background-color: #ffc300; border: 1px solid #b87333; padding: 10px">
<strong>
You're reading the documentation of the
<a href="./">{{current_version.name}}</a>. For the latest released version,
please have a look at
<a href="{{ vpathto(latest_version.name) }}">{{latest_version.name}}</a>.
</strong>
</p>
{% endif %} {{ super() }} {% endblock %}%
================================================
FILE: docs/source/_templates/versions.html
================================================
{%- if current_version %}
<div
class="rst-versions"
data-toggle="rst-versions"
role="note"
aria-label="versions"
>
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Other Versions</span>
v: {{ current_version.name }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
{%- if versions.tags %}
<dl>
<dt>Tags</dt>
{%- for item in versions.tags %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %} {%- if versions.branches %}
<dl>
<dt>Branches</dt>
{%- for item in versions.branches %}
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
{%- endfor %}
</dl>
{%- endif %}
</div>
</div>
{%- endif %}
================================================
FILE: docs/source/backends.rst
================================================
Simulation Back-ends
====================
To run a simulation, computing back-ends implemented from state of the art algorithms are available in Perceval.
Each of these back-ends has different capabilities that we describe in that section.
All Perceval simulation back-ends act on perfect input Fock states on a fixed unitary circuit.
Nonetheless, Perceval aims at supporting noisy and non-unitary simulations. These real life use cases are covered in the
next part of the tutorial.
I. Back-end features
--------------------
Sampling a.k.a Weak Simulation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sampling is the simulation task closest to the actual running of a physical circuit. Given known input states, the
sampling will produce output states one at a time as it would be observed by ideal detectors. Sampling is considered
as a weak simulation of a circuit, since it does not give explicit output distribution, nor the nature of the mixture
states generated by the circuit but a mere observation of individual outputs.
Sampling has been studied in length (see :cite:t:`clifford_classical_2018`, :cite:t:`clifford2020faster`), in the context of Boson Sampling, as a classical
computing challenge pushing further the limit of the quantum supremacy.
Strong Simulation
^^^^^^^^^^^^^^^^^
Strong(er) Simulation (see :cite:t:`heurtel2022`) of a circuit should provide an access to complete distribution and nature of the output state.
Compared to *Sampling*, circuit designer are interested in the actual probabilistic distribution of the outputs and their
exact characteristic.
In particular, for a :math:`m` port circuit, one would like to know the exact expected probability of detecting photons
on a given port, and not a mere estimation based on sampling observations. We also differentiate here the ability of getting the
probability (or probability amplitude) of a single output, and the possibilities of getting probabilities of all the different
outputs for a give input state.
Also, even for a simple circuit showing an equiprobable probability of detecting
:math:`\ket{0,1}` and :math:`\ket{1,0}`, we would want to know if the output is :math:`\frac{1}{\sqrt 2}(\ket{0,1}+\ket{1,0})` or
:math:`\frac{1}{\sqrt 2}(\ket{0,1}-\ket{1,0})` which are very distinct states.
Finally, a fine-grained simulation would need not only to give output state probability but also *probability amplitude*.
Indeed, probability amplitude is required for further evolution of the output states, but also analysis of polarization
for circuit with polarization support, etc.
II. Back-end comparison
-----------------------
Perceval has 6 different built-in back-ends with the support of optimized C++ library.
Comparison Table
^^^^^^^^^^^^^^^^
.. list-table::
:header-rows: 1
:stub-columns: 1
:width: 100%
:align: center
* - Features \ Name
- :ref:`CliffordClifford2017`
- :ref:`SLOS`
- :ref:`Naive`
- :ref:`NaiveApprox`
- :ref:`MPS`
- :ref:`SLAP`
* - Sampling Efficiency
- :math:`\mathrm{O}(n2^n+poly(m,n))`
- :math:`\mathrm{O}(mC_n^{n+m-1})`
- *N/A* [1]_
- *N/A* [1]_
- *N/A* [1]_
- Theoretically :math:`\mathrm{O}(n2^n+poly(m,n))`
* - Single output Efficiency
- *N/A*
- *N/A*
- :math:`\mathrm{O}(n2^n)`
- :math:`\mathrm{O}(n)`
- :math:`\mathrm{O}(N_cC_n^{n+m-1})`
- :math:`\mathrm{O}(n2^n)`
* - Full Distribution Efficiency
- *N/A*
- :math:`\mathrm{O}(nC_n^{n+m-1})`
- :math:`\mathrm{O}(n2^nC_n^{n+m-1})`
- :math:`\mathrm{O}(nC_n^{n+m-1})`
- :math:`\mathrm{O}(N_cC_n^{n+m-1})`
- :math:`\mathrm{O}(\begin{equation} 2n\times \sum_{k=1}^n \binom{n-1}{k-1} \times \binom{m+k-1}{m-1} \label{eq:complex} \end{equation})`
* - Probability Amplitude
- **No**
- **Yes**
- **Yes**
- **Yes**
- **Yes**
- **Yes**
* - Practical Limits
- :math:`n\approx30`
- :math:`n,m<20`
- :math:`n\approx30`
-
-
- :math:`n,m<20`
where:
* :math:`n` is the number of photons
* :math:`m` is the number of modes
* :math:`N_c` is the number of elementary circuits
CliffordClifford2017
^^^^^^^^^^^^^^^^^^^^
This backend is the implementation of the algorithm introduced in :cite:t:`clifford_classical_2018`.
The algorithm, applied to Boson Sampling, aims to *produce provably correct random samples from a particular quantum mechanical distribution*.
Its time and space complexity are respectively :math:`\mathrm{n2^n+mn^2}` and :math:`\mathrm{m}` (in addition to matrix storing).
The algorithm has been implemented in C++, and uses an adapted Glynn algorithm :cite:t:`glynn2010permanent` to efficiently
compute :math:`n` simultaneous *sub-permanents*.
Recently, the same authors have proposed a faster algorithm in :cite:t:`clifford2020faster` with an average time
complexity of :math:`\mathrm{n\rho_\theta^n}` for a number of modes :math:`m=\theta n` which is linear in the number of
photons :math:`n`, where:
.. math::
\rho_\theta = \frac{(2\theta+1)^{2\theta+1}}{(4\theta)^{\theta}(\theta+1)^{\theta+1}}
For example, if we were to work with dual rail path encoding (ignoring for now the number of auxiliary modes required),
we would typically work with :math:`\theta=2`, and the average performance is then
:math:`\mathrm{n(\frac{5^5}{8^23^3})^n} \approx \mathrm{n1.8^n}`.
See also, its code reference: :ref:`Clifford2017Backend`
SLOS
^^^^
The Strong Linear Optical Simulation ``SLOS`` algorithm developed by a subset of the present authors is introduced in
:cite:t:`heurtel2022`. It unfolds the full computation path in memory, leading to a remarkable time complexity of
:math:`\mathrm{nC_n^{n+m-1}}` for computing the full distribution. The current implementation also allows restrictive
sets of outputs, with average computing time in :math:`\mathrm{n\rho_\theta^n}` for single output computation. As
discussed in :cite:t:`heurtel2022`, Boson Sampling with ``SLOS`` is possible with the time complexity of
:cite:t:`clifford2020faster`, though it has not yet been implemented in the current version of Perceval.
The tradeoff in this approach is a huge memory usage in :math:`\mathrm{nC^{n+m-1}_n}` that limits usage on personal
computers to circuits with :math:`\approx 20` photons and to :math:`\approx 24` photons on super-computers.
See also, its code reference: :ref:`SLOSBackend`
SLAP
^^^^
The Simulator of LAttice of Polynomials ``SLAP`` algorithm computes all output probability amplitudes at once by
iterating over a lattice of intermediary results representation.
It is designed to require less memory than ``SLOS`` (:math:`2^n` complex values) at the cost of a slightly higher
computation time. The algorithm is introduced in :cite:t:`goubault2025`.
This feature is still under development, however, in the future, we expect this backend:
* to reach a sampling efficiency of :math:`\mathrm{O}(n2^n+poly(m,n))`
* to be faster than SLOS in the regime :math:`m >> n`
See also, its code reference: :ref:`SLAPBackend`
Naive
^^^^^
This backend implements direct permanent calculation and is therefore suited for single output probability computation
with small memory cost. Both Ryser's (:cite:t:`ryser1963combinatorial`) and Glynn's (:cite:t:`glynn2010permanent`) algorithms
have been implemented. Extra-care has been taken on the implementation of these algorithms, with usage of different
optimisation techniques including native multithreading and SIMD vectorisation primitives. Benchmarking of these
algorithms and comparison with the implementation present in the
`The Walrus library <https://github.com/XanaduAI/thewalrus>`_ is provided in following figure:
.. figure:: _static/img/performance-permanent.png
:width: 800
:align: center
Comparison of the average time [#]_ to calculate a permanent of an :math:`n\times n` Haar random matrix. The processor
is a 32 core, 3.1GHz Intel Haswell. For *The Walrus*, version 0.19 is used and installed from
`pypi <https://pypi.org>`_. The Ryser implementation is run on 4 or 32 threads.
The Glynn implementation is run on a single thread.
What is interesting to note is that all implementations have convergence to the theoretical performance but the
factor between optimised and less optimised implementation still makes a perceptible time difference for the end-user.
See also, its code reference: :ref:`NaiveBackend`
NaiveApprox
^^^^^^^^^^^
This backend does the same computations as Naive, but uses Gurvits estimate to compute the permanent (see :cite:t:`gurvits2002`).
Aside of usual probability() and prob_amplitude() methods, it offers a 99% confidence interval on the probability, or a
99% sure error bound on the amplitude.
A better accuracy can be obtained with a higher iteration count.
With this approximated backend, you can achieve a few probability estimates for high photon counts.
See also, its code reference: :ref:`NaiveApproxBackend`
MPS
^^^
Matrix Product State (MPS) is based on a type of tensor network simulation, which gives an approximation of the output
states (see :cite:t:`schollwock2011density` and :cite:t:`oh2021classical`).
As the Stepper, MPS backend does the computation on each component of the circuits one-by-one, and not on the whole unitary, but has the unique feature of performing approximate state evolution.
The states are represented by tensors, which are then updated at each component.
These tensors can be seen as a big set of matrices, and the approximation is done by choosing the dimension of these matrices, called the *bond* dimension.
See also, its code reference: :ref:`MPSBackend`
.. rubric:: Footnotes
.. [1] Those backends technically support sampling, but to do so, they need to compute the full output distribution then
sample on it, which is totally inefficient.
.. [#] Following the methodology presented at https://the-walrus.readthedocs.io/en/latest/gallery/permanent_tutorial.html.
================================================
FILE: docs/source/bibliography.rst
================================================
Bibliography
============
.. bibliography::
:all:
================================================
FILE: docs/source/build_catalog.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from perceval import catalog
def get_pretty_string(s: str):
out = ''
for i, c in enumerate(s):
if i == 0:
out += c.upper()
continue
if s[i-1] == ' ':
out += c.upper()
continue
out += c
return out
def build_catalog_rst(path: str):
out = ''
for key in catalog.list():
item = catalog[key]
out += get_pretty_string(item.name) + '\n'
out += '-'*len(item.name) + '\n\n'
out += f'Catalog key: ``{item.name}``\n\n'
out += item.description + '\n\n'
if item.params_doc:
out += 'Parameters:\n'
for param_name, param_descr in item.params_doc.items():
out += f' * ``{param_name}``: {param_descr}\n'
out += '\n'
out += '.. code-block::\n\n'
out += ' ' + item.str_repr.replace('\n', '\n ')+'\n\n'
if item.see_also:
out += f'See also: {item.see_also}\n\n'
if item.article_ref:
out += f'Scientific article reference: {item.article_ref}\n\n'
with open(path, 'w', encoding="utf-8") as file:
file.write(out)
================================================
FILE: docs/source/conf.py
================================================
# MIT License
#
# Copyright (c) 2022 Quandela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# As a special exception, the copyright holders of exqalibur library give you
# permission to combine exqalibur with code included in the standard release of
# Perceval under the MIT license (or modified versions of such code). You may
# copy and distribute such a combined system following the terms of the MIT
# license for both exqalibur and Perceval. This exception for the usage of
# exqalibur is limited to the python bindings used by Perceval.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
"""
conf.py used by sphinx to build docs
The repo is copied to the correct commit of the tag
Then this file is interpreted
"""
import os
import sys
from datetime import datetime
from pathlib import Path
sys.path.insert(0, os.path.relpath("../"))
from source import build_catalog
from perceval import PMetadata
REPO_PATH = Path(__file__).parent.parent.parent.resolve()
build_directory = os.path.join(REPO_PATH, "docs", "build")
if not os.path.exists(build_directory):
os.makedirs(build_directory)
build_catalog.build_catalog_rst(os.path.join(build_directory, "catalog.rst"))
# -- Project information -----------------------------------------------------
project = PMetadata.name()
copyright = f"{datetime.now().year}, {PMetadata.author()[0].capitalize() + PMetadata.author()[1:]}"
author = PMetadata.author()
release = PMetadata.short_version()
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.mathjax",
"sphinx_autodoc_typehints",
"sphinx.ext.autosectionlabel",
"sphinxcontrib.bibtex",
"enum_tools.autoenum",
"nbsphinx",
"sphinx_multiversion",
]
suppress_warnings = ['autosectionlabel.*']
bibtex_bibfiles = ["references.bib"]
bibtex_default_style = "plain"
bibtex_reference_style = "label"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_theme_options = {
"navigation_depth": 2,
"titles_only": False,
}
html_style = "css/style.css"
html_logo = "_static/img/Perceval logo white 160X160.png"
html_favicon = "_static/img/Perceval icon white 32x32.ico"
nbsphinx_execute_arguments = [
"--InlineBackend.figure_formats={'svg', 'pdf'}",
"--InlineBackend.rc={'figure.dpi': 96}",
]
================================================
FILE: docs/source/contributing.rst
================================================
Contributions
=============
Initial Contributors
--------------------
The first contributors to the frameworks are (alphabetically ordered):
Nadia Belabas [C2N]_,
Boris Bourdoncle [QUA]_,
Pierre-Emmanuel Emeriau [QUA]_,
Andreas Fyrillas [QUA]_,
Grégoire de Gliniasty [QUA]_,
Nicolas Heurtel [QUA]_,
Raphaël Le Bihan [QUA]_,
Sébastien Malherbe [ENS]_,
Rawad Mezher [QUA]_,
Shane Mansfield [QUA]_,
Luka Music [QUA]_,
Marceau Paillhas [QUA]_,
Jean Senellart [QUA]_,
Pascale Senellart [QUA]_ [C2N]_,
Mario Valdiva [QUA]_,
Benoît Valiron [CEN]_
.. [C2N] Centre for Nanosciences and Nanotechnology, CNRS, Universite Paris-Saclay, UMR 9001, 10 Boulevard Thomas Gobert, 91120, Palaiseau, France
.. [QUA] Quandela, 7 Rue Léonard de Vinci, 91300 Massy, France
.. [ENS] Ecole Normale Supérieure, 45 rue d’Ulm, 75230 Paris, France
.. [CEN] Université Paris-Saclay, Inria, CNRS, ENS Paris-Saclay, Centrale Supélec, LMF, 91190, 15 Gif-sur-Yvette, France
Welcoming Contributors
----------------------
Perceval has been built and open-source for the benefit of the full photonics quantum community.
You can contribute by sharing feedback, questions, ideas, feedback on experiments on our forum at
https://perceval.quandela.net/forum.
As a community project, you are also welcome to fork Perceval and submitting merge requests.
See https://github.com/Quandela/Perceval/blob/main/CONTRIBUTING.md for more information.
================================================
FILE: docs/source/examples_boson_sampling.rst
================================================
Boson Sampling
==============
.. toctree::
:maxdepth: 2
notebooks/Boson_sampling
notebooks/MPS_techniques_for_boson_sampling
================================================
FILE: docs/source/examples_others.rst
================================================
Others
======
.. toctree::
:maxdepth: 2
notebooks/Gedik_qudit
notebooks/Boson_Bunching
notebooks/quantum_kernel_methods
notebooks/BS-based_implementation
notebooks/LOv_rewriting_rules
================================================
FILE: docs/source/examples_quantum_walk.rst
================================================
Quantum Walk
============
.. toctree::
:maxdepth: 2
notebooks/Two-particle_bosonic-fermionic_quantum_walk
================================================
FILE: docs/source/examples_standard_algo.rst
================================================
Standard Quantum Algorithms
===========================
.. toctree::
:maxdepth: 2
notebooks/Walkthrough-cnot
notebooks/Shor_Implementation
notebooks/2-mode_Grover_algorithm
================================================
FILE: docs/source/examples_vqa.rst
================================================
Variational Quantum Algorithms
==============================
.. toctree::
:maxdepth: 2
notebooks/Differential_equation_resolution
notebooks/Variational_Quantum_Eigensolver
notebooks/Reinforcement_learning
notebooks/QUBO
================================================
FILE: docs/source/getting_started.rst
================================================
Getting started
===============
What is Perceval?
^^^^^^^^^^^^^^^^^
Perceval is a toolbox containing generic functions and classes, built around an optimised native core (see
:ref:`exqalibur` code reference).
It offers tools to:
* Manipulate quantum states in the Fock space
* Pure states (:ref:`FockState`, :ref:`StateVector`)
* Mixed states (:ref:`SVDistribution`, :ref:`DensityMatrix`)
* Build a linear optics :ref:`Experiment` containing
* A unitary :ref:`Circuit` composed of :ref:`Unitary Components`
* Some :ref:`Non-unitary Components`
* Feed-forward through :ref:`Feed-forward Configurators`
* Variable :ref:`parameters<Parameter>` and :ref:`expressions<Expression>` to parametrise components
* Display circuits and data (:ref:`pdisplay`), serialise them (:ref:`serialization`)
* Define real-world noise parameters applied in the input, the linear-optics circuit and the photon detectors (:ref:`Noise Model`)
* Simulate these experiments through :ref:`different layers of simulations<I. Different layers of simulation>`
* Perfect simulations with :ref:`Simulation Back-ends`
* Noisy and non-unitary simulations with the :ref:`Simulator` layer
* Control the flow of quantum computations and choose where they are run:
* Locally with the :ref:`Processor`, remotely with the :ref:`RemoteProcessor`
* Manage your :ref:`jobs<Job>` with the :ref:`JobGroup`
Installing Perceval
^^^^^^^^^^^^^^^^^^^
*Perceval* supports several *Python* versions (typically, `those that are not in "end-of-life" <https://devguide.python.org/versions/>`_).
In a virtual environment of any *Python* supported version, a single :code:`pip` command installs Perceval and all of
its dependencies.
.. code-block:: bash
$ pip install perceval-quandela
.. warning::
Pay attention that the *Python* package name is "perceval-quandela" and not "perceval"
Once the above command succeeds, you can start typing code in your favorite IDE!
Hello world
^^^^^^^^^^^
The following example is a minimal code to simulate the `Hong–Ou–Mandel effect <https://en.wikipedia.org/wiki/Hong%E2%80%93Ou%E2%80%93Mandel_effect>`_
on the user's computer in a noisy situation, and retrieve both a sample count and exact probabilities computed by a
strong simulation back-end.
>>> import perceval as pcvl
>>> from perceval.algorithm import Sampler
>>>
>>> input_state = pcvl.BasicState("|1,1>") # Inject one photon on each input mode...
>>> circuit = pcvl.BS() # ... of a perfect beam splitter
>>> noise_model = pcvl.NoiseModel(transmittance=0.05, indistinguishability=0.85) # Define some noise level
>>>
>>> processor = pcvl.Processor("SLOS", circuit, noise=noise_model) # Use SLOS, a strong simulation back-end
>>> processor.min_detected_photons_filter(1) # Accept all output states containing at least 1 photon
>>> processor.with_input(input_state)
>>>
>>> sampler = Sampler(processor)
>>> samples = sampler.sample_count(10_000)['results'] # Ask to generate 10k samples, and get back only the raw results
>>> probs = sampler.probs()['results'] # Ask for the exact probabilities
>>> print(f"Samples: {samples}")
>>> print(f"Probabilities: {probs}")
Samples: {
|2,0>: 117
|0,2>: 147
|1,0>: 4822
|1,1>: 22
|0,1>: 4892
}
Probabilities: {
|2,0>: 0.011858974358974369
|0,2>: 0.011858974358974369
|1,1>: 0.0019230769230769245
|1,0>: 0.48717948717948717
|0,1>: 0.48717948717948717
}
Now that you can run some code, let's continue with a tutorial to learn Perceval syntax.
================================================
FILE: docs/source/index.rst
================================================
:github_url: https://github.com/Quandela/Perceval
.. figure:: _static/img/perceval.jpg
:align: right
:width: 250
:figwidth: 250
:alt: Extract from Chrétien de Troyes
Perceval, the Story of the Grail – Chrétien de Troyes (circa 1180)
Welcome to the Perceval documentation!
======================================
Perceval is an open source linear optics quantum framework. It provides a powerful language to describe linear optics
setups through a simple object-oriented API, and is able to simulate them and send computation requests to remote
Quantum Processing Units (QPU) and simulators.
* To start using Perceval, see: :ref:`Getting started`
* To contribute to Perceval, see: :ref:`Welcoming Contributors`
Perceval has been developed as a complete toolkit for physicists, computer scientists, students, researchers,
and practitioners of quantum computing. It can be used to reproduce published experimental works or to experiment
directly with a new generation of quantum algorithms.
.. |pcvl_paper_link| raw:: html
<a href="https://arxiv.org/abs/2204.00602" target="_blank">Perceval white paper</a>
If you are using Perceval for academic work, please cite the |pcvl_paper_link| as:
.. code:: latex
@article{heurtel2023perceval,
doi = {10.22331/q-2023-02-21-931},
url = {https://doi.org/10.22331/q-2023-02-21-931},
title = {Perceval: {A} {S}oftware {P}latform for {D}iscrete {V}ariable {P}hotonic {Q}uantum {C}omputing},
author = {Heurtel, Nicolas and Fyrillas, Andreas and Gliniasty, Gr{\'{e}}goire de and Le Bihan, Rapha{\"{e}}l and Malherbe, S{\'{e}}bastien and Pailhas, Marceau and Bertasi, Eric and Bourdoncle, Boris and Emeriau, Pierre-Emmanuel and Mezher, Rawad and Music, Luka and Belabas, Nadia and Valiron, Benoît and Senellart, Pascale and Mansfield, Shane and Senellart, Jean},
journal = {{Quantum}},
issn = {2521-327X},
publisher = {{Verein zur F{\"{o}}rderung des Open Access Publizierens in den Quantenwissenschaften}},
volume = {7},
pages = {931},
month = feb,
year = {2023}
}
Related Projects
================
.. |interop_link| raw:: html
<a href="https://perceval.quandela.net/interopdocs/" target="_blank">perceval-interop</a>
.. |merlinquantum_link| raw:: html
<a href="https://merlinquantum.ai/" target="_blank">merlinquantum</a>
Perceval is used in several higher-level projects (non-exhaustive list):
* **perceval-interop**: Interoperability tools for conversion between photonic and gate based Quantum computing. See
the project here: |interop_link|.
* **MerLin**: A framework to bring quantum computing to AI practitioners, requiring no prior quantum expertise.
Learn more here: |merlinquantum_link|.
.. toctree::
:maxdepth: 2
:hidden:
getting_started
tutorial_beginner
tutorial_advanced
tutorial_expert
legacy
.. toctree::
:caption: Code Reference
:maxdepth: 2
:hidden:
reference/algorithm/index
reference/backends/index
reference/components/index
reference/error_mitigation
reference/providers
reference/rendering/index
reference/runtime/index
reference/serialization
reference/simulators/index
reference/utils/index
reference/exqalibur/index
.. toctree::
:caption: Examples
:maxdepth: 2
:hidden:
examples_boson_sampling
examples_standard_algo
examples_vqa
examples_quantum_walk
examples_others
.. toctree::
:caption: Community
contributing
bibliography
================================================
FILE: docs/source/legacy.rst
================================================
Legacy
======
While, with its latest versions, Perceval tends to stabilise its public API, some changes may break existing user code.
This section lists the major breaking changes.
Breaking changes in Perceval 1.1
--------------------------------
JobGroup number of parallel launch
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The number of jobs that a user can run is now directly retrieved from the cloud.
AS such, the `set_cloud_maximal_job_count` and `get_cloud_maximal_job_count` from `RemoteConfig` are now deprecated and no longer work.
Breaking changes in Perceval 1.0
--------------------------------
FockState was split in three different classes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To achieve better optimisation in noisy simulation and to clarify the intent of different states usage, it has been
decided to get rid of the former generic :code:`FockState` that could hold richly annotated photons as well as just a
plain perfect state.
Definition of the new classes
.............................
* :code:`FockState`: A light-weight object only containing photon positions in mode (e.g. :code:`|1,0,1>`). Can be used to
represent detections.
* :code:`NoisyFockState`: A collection of indistinguishable photon groups, that are totally distinguishable. The
distinguishability index is an integer and is referred to as the `noise tag` (e.g. :code:`|{0},{1},{0}{2}>` contains
three groups of indistinguishable photons tagged 0, 1 and 2).
* :code:`AnnotatedFockState`: Replace the previous :code:`FockState` by allowing rich annotations, having one or more
string types, each having a complex number for value. This enables to accurately encode physical parameters and
play with partial distinguishability (e.g. :code:`|{P:H,lambda:0.625},{P:V,lambda:0.618}>`). Please note that apart
from polarisation, `Perceval` does not provide a generic algorithm to separate rich annotated states, and the user
would have to write one.
The most breaking change here is that perceval is not able to simulate :code:`AnnotatedFockState`, apart from polarized ones.
Any code manually using annotations to generate distinguishability must be changed to use the new :code:`NoisyFockState` class.
For instance, a :code:`BasicState("|{_:0}, {_:1}>")` from perceval 0.x must be changed to :code:`BasicState("|{0}, {1}>")`
to be able to be simulated.
For more advanced usage of :code:`AnnotatedFockState` and :code:`NoisyFockState`, see the new :ref:`Quantum States` notebook.
Some calls will use or return only the type that makes sense (e.g. :code:`AnnotatedFockState::threshold_detection()`
always returns a :code:`FockState` as a detected state naturally loses all kinds of photon annotation.
.. note:: Note that arithmetic still works between states of different types. The result is the most complex type of
both operands (e.g. :code:`NoisyFockState` ⊗ :code:`FockState` gives a :code:`NoisyFockState`).
Usage in Perceval
.................
The :code:`BasicState` class still exists and has the same responsibility as before: representing any non superposed
pure state. It can construct any of the forementioned state type from a string representation, of vectors of position,
and optionally noise tags or annotations.
Even though, `Perceval` code makes it so :code:`isinstance(any_fockstate, BasicState)` returns :code:`True`, the type
hinting of user code in an IDE could alert that the types do not match after the update.
.. note:: :code:`StateVector` (and therefore :code:`SVDistribution`) accepts any of the three Fock state types as
components.
Processor add with Component or Circuit
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When adding a Circuit or a Component to a Processor on non-consecutive modes, a permutation was added so that we could
add the component to the Processor. The inverse permutation is now also added after the component so that the in-between
modes are not impacted by the addition, similarly to what was already done when adding a Processor to a Processor.
BSDistribution and SVDistribution
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
These classes have been moved to Exqalibur with a C++ implementation.
As such, they are no longer Python dictionaries and may not support some advanced dict features.
This has several consequences:
- You can no longer instantiate :code:`BSDistribution` or :code:`SVDistribution` using a dictionary with mixed type keys,
nor with non-BasicState or non-StateVector keys.
- :code:`BSDistribution` and :code:`SVDistribution` can no longer be compared to a regular :code:`dict` (for example by using :code:`==`).
- The order of insertion is no longer preserved.
- :code:`keys()` and :code:`values()` methods now return an iterator, so methods like :code:`len` no longer work on
their result.
Also, note that:
- Inserting a :code:`StateVector` in :code:`SVDistribution` no longer normalises it.
- Using the tensor product with an empty distribution now always returns an empty distribution.
To keep the same behaviour as before (the result was the non-empty distribution), one would have to
replace the empty distribution by a distribution containing a void state (:code:`BSDistribution(BasicState())`) for
tensor product or a 0-photon state (:code:`BSDistribution(BasicState(m))`) for a merge.
StateVector
^^^^^^^^^^^
The method :code:`StateVector.keys()` now returns an iterator on the keys instead of a BSSamples.
This avoids doing unnecessary copy.
Please note that due to this change:
- Keys must now be copied before being modified when iterating on :code:`StateVector.keys()`.
- :code:`StateVector.keys()` no longer has list methods such as :code:`len`, :code:`__getitem__`...
Removal of deprecated methods and classes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following methods and classes have been removed or definitely modified as they were deprecated:
- :code:`TokenProvider` (deprecated since 0.13, replaced by :code:`RemoteConfig`)
- :code:`AProbAmpliBackend` (deprecated since 0.12, replaced by :code:`AStrongSimulationBackend`)
- :code:`postselect_independent` (deprecated since 0.12, replaced by :code:`PostSelect` method :code:`is_independent_with`)
- The :code:`n` parameter of SLOS backend (deprecated since 0.12, now automatically chosen when using :code:`set_input_state`)
- :code:`thresholded_output` method of :code:`Processor` and :code:`RemoteProcessor`
(deprecated since 0.12, replaced by adding several :code:`Detector.threshold()`)
- :code:`with_polarized_input` method of :code:`Processor` (because :code:`Processor.with_input` is now able to handle
a polarized :code:`AnnotatedFockState` transparently)
- :code:`tensorproduct(states: list)` from :code:`perceval.utils` (due to tensor products being handled well by
multiplication operators and specific methods - see :code:`BSDistribution.list_tensor_product`, for instance)
- :code:`JobGroup.list_existing()` has been renamed into :code:`JobGroup.list_locally_saved()`
NoiseModel
^^^^^^^^^^
The way of :code:`NoiseModel` to handle its attributes has changed to be more pythonic.
Now, your IDE should be able to tell that the attributes exist in the class,
and the attributes can be changed using a syntax like :code:`noise_model.g2 = 0.1`.
This change is accompanied by the removal of some methods:
- The :code:`__getitem__` has been removed since it was giving a class that is not accessible anymore
- The :code:`set_value` method has been removed, and can be replaced either by spelling directly the attribute (:code:`noise_model.g2 = 0.1`)
or by using the python method :code:`setattr(noise_model, "g2", 0.1)`.
Older changes
-------------
The documentation to update from an older legacy version to a more recent one can still be found
`here <https://perceval.quandela.net/docs/v0.13/legacy.html>`_.
================================================
FILE: docs/source/notebooks/2-mode_Grover_algorithm.ipynb
================================================
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"id": "3a271506",
"metadata": {},
"source": [
"# 2-mode Grover's search algorithm"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "34fa32af",
"metadata": {},
"source": [
"We implement in this notebook a 2-mode optical realization of Grover's search algorithm, based on Kwiat et al. (2000). Grover’s search algorithm: An optical approach. [Journal of Modern Optics](https://doi.org/10.1080/09500340008244040), 47(2–3), 257–266."
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "e22c5dde",
"metadata": {},
"source": [
"## Introduction"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "c04c528f",
"metadata": {},
"source": [
"### Motivation\n",
"\n",
"Searching for a specific item (called the marked item) in an unstructured list of $N$ items requires $O(N)$ accesses to the list classically. Grover showed in 1996 that is possible for a quantum computer to achieve this using only $O\\left(\\sqrt{N}\\right)$ iterations."
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "08145e4a",
"metadata": {},
"source": [
"### Algorithm summary\n",
"\n",
"For a list of size $N$, Grover's algorithm requires $\\log (N)$ qubits. The algorithm starts by setting each qubit in the superposition state $\\frac{1}{\\sqrt{2}}\\left(|0\\rangle+|1\\rangle\\right)$. Then it applies $O\\left(\\sqrt{N}\\right)$ iterations of a subroutine called inversion-about-mean, whose goal is to skew this initial uniform superposition state towards the desired marked state such the probability of measuring the marked state is amplified. This subroutine requires the application of an oracle unitary, which applies a relative $\\pi$ phase shift only to the quantum state encoding the item we are looking for in the database."
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "5690fa9d",
"metadata": {},
"source": [
"### Kwiat et al. implementation details\n",
"\n",
"The optical implementation of Kwiat et al. uses the polarization and path degree of freedom of a single beam to achieve a 2-qubit optical implementation of Grover's search algorithm. Although $N=4$ here, calculations show that only a single application of the inversion-about-mean subroutine is required.\n",
"\n",
"In an effort to reduce the number of optical components used in the experimental setup, the authors work with a compiled version of the circuit, which we will reproduce here using Perceval."
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "7bc2f8dc",
"metadata": {},
"source": [
"## Perceval implementation"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "904f535e",
"metadata": {},
"source": [
"### Initialisation"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "4d4c8ff1",
"metadata": {},
"outputs": [],
"source": [
"import math\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import perceval as pcvl\n",
"from perceval.algorithm import Analyzer"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "09fa856a",
"metadata": {},
"source": [
"We create in Perceval a circuit with two spatial modes, $a$ and $b$ denoting resapectively the lower and upper spatial modes. For clarity, the different equivalent encodings for each of the four basis states are given below in order:\n",
"- marked item encoding: $\\left|\"00\"\\right\\rangle$, $\\left|\"01\"\\right\\rangle$, $\\left|\"10\"\\right\\rangle$, $\\left|\"11\"\\right\\rangle$\n",
"- Kwiat et al. path and polarization encoding: $\\left|aH\\right\\rangle$, $\\left|aV\\right\\rangle$, $\\left|bH\\right\\rangle$, $\\left|bV\\right\\rangle$\n",
"- Perceval path and polarization encoding: $\\left|0, 1:H\\right\\rangle$, $\\left|0, 1:V\\right\\rangle$, $\\left|1:H, 0\\right\\rangle$, $\\left|1:V, 0\\right\\rangle$\n",
"\n",
"We first define these states and their mode equivalent in Perceval:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "b8084f08",
"metadata": {},
"outputs": [],
"source": [
"states = [pcvl.BasicState(\"|0,{P:H}>\"),\n",
" pcvl.BasicState(\"|0,{P:V}>\"),\n",
" pcvl.BasicState(\"|{P:H},0>\"),\n",
" pcvl.BasicState(\"|{P:V},0>\"),\n",
" ]\n",
"\n",
"states_modes = [\n",
" pcvl.BasicState([0, 0, 0, 1]),\n",
" pcvl.BasicState([0, 0, 1, 0]),\n",
" pcvl.BasicState([0, 1, 0, 0]),\n",
" pcvl.BasicState([1, 0, 0, 0])\n",
"]"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "fab191db",
"metadata": {},
"source": [
"We use the following unitary matrix to represent the beamsplitters:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a3560b8f",
"metadata": {},
"outputs": [
{
"data": {
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\frac{\\sqrt{2}}{2} & - \\frac{\\sqrt{2}}{2}\\\\\\frac{\\sqrt{2}}{2} & \\frac{\\sqrt{2}}{2}\\end{matrix}\\right]$"
],
"text/plain": [
"<IPython.core.display.Math object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"bsry = pcvl.BS.Ry()\n",
"pcvl.pdisplay(bsry.U)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "54638f8d",
"metadata": {},
"source": [
"The half-wave plates are defined in the article as:"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "54d17968",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
" width=\"257.5\" height=\"93.75\" viewBox=\"-28.0 0 206.0 75.0\">\n",
"<defs>\n",
"</defs>\n",
"<path d=\"M10,25.0 L25,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M25,25 L75,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M38,7 L52,7 L52,43 L38,43 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M45,7 L45,43\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"53.5\" y=\"36\" font-size=\"7\" text-anchor=\"start\">ξ=pi/2</text>\n",
"<text x=\"53.5\" y=\"45\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M75,25 L125,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M80,40 L89,40 L103,10 L94,10 L80,40 L89,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"97\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M125,25.0 L140,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<text x=\"150\" y=\"28.0\" font-size=\"6\" text-anchor=\"end\">0</text>\n",
"<text x=\"0\" y=\"28.0\" font-size=\"6\" text-anchor=\"start\">0</text>\n",
"</svg>"
],
"text/plain": [
"<drawsvg.drawing.Drawing at 0x26d3d5ac440>"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def HWP(xsi):\n",
" hwp = pcvl.Circuit(m=1)\n",
" hwp.add(0, pcvl.HWP(xsi)).add(0, pcvl.PS(-math.pi/2))\n",
" return hwp\n",
"\n",
"pcvl.pdisplay(HWP(math.pi/2))"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "3d3c98ab",
"metadata": {},
"source": [
"### Circuit Construction"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b2c267cb",
"metadata": {},
"source": [
"We divide the compiled circuit of Kwiat et al. in three parts: [state initialization](#state-initialization-circuit), [oracle](#oracle) and [inversion about mean](#inversion-about-mean). However, due to the compilation, each individual part does not act exactly as described in the introduction."
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "14ee9683",
"metadata": {},
"source": [
"\n",
"#### State initialization circuit"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "f6718866",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
" width=\"445.0\" height=\"156.25\" viewBox=\"-28.0 0 356.0 125.0\">\n",
"<defs>\n",
"</defs>\n",
"<path d=\"M10,25.0 L25,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,75.0 L25,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M25,25 L75,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M38,7 L52,7 L52,43 L38,43 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M45,7 L45,43\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"53.5\" y=\"36\" font-size=\"7\" text-anchor=\"start\">ξ=pi/8</text>\n",
"<text x=\"53.5\" y=\"45\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M75,25 L125,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M80,40 L89,40 L103,10 L94,10 L80,40 L89,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"97\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M25,75.0 L125,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M125,25 L153,25 L172,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M178,44 L197,25 L225,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M125,75 L153,75 L172,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M178,56 L197,75 L225,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M150,43 L200,43 L200,57 L150,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"175\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"175\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M150,43 L200,43 L200,47 L150,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M193,50 L203,50 L203,60 L193,60 Z\" stroke=\"black\" fill=\"lightsalmon\" stroke-linejoin=\"miter\" />\n",
"<text x=\"198\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Ry</text>\n",
"<path d=\"M225,25 L275,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M230,40 L239,40 L253,10 L244,10 L230,40 L239,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"247\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=pi</text>\n",
"<path d=\"M225,75.0 L275,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M275,25.0 L290,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M275,75.0 L290,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<text x=\"300\" y=\"28.0\" font-size=\"6\" text-anchor=\"end\">0</text>\n",
"<text x=\"300\" y=\"78.0\" font-size=\"6\" text-anchor=\"end\">1</text>\n",
"<text x=\"0\" y=\"28.0\" font-size=\"6\" text-anchor=\"start\">0</text>\n",
"<text x=\"0\" y=\"78.0\" font-size=\"6\" text-anchor=\"start\">1</text>\n",
"</svg>"
],
"text/plain": [
"<drawsvg.drawing.Drawing at 0x26d3d5cc050>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"init_circuit = (pcvl.Circuit(m=2, name=\"Initialization\")\n",
" // HWP(math.pi / 8)\n",
" // bsry\n",
" // pcvl.PS(-math.pi))\n",
"\n",
"pcvl.pdisplay(init_circuit)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "e8278f70",
"metadata": {},
"source": [
"#### Oracle\n",
"\n",
"The oracle circuit can be initialised so that any one of the four list elements are marked. This is controlled via the integer parameter $mark \\in [0, 3]$."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "96aba62a",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
" width=\"320.0\" height=\"156.25\" viewBox=\"-28.0 0 256.0 125.0\">\n",
"<defs>\n",
"</defs>\n",
"<path d=\"M10,25.0 L25,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,75.0 L25,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M25,25 L75,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M38,7 L52,7 L52,43 L38,43 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M45,7 L45,43\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"53.5\" y=\"36\" font-size=\"7\" text-anchor=\"start\">ξ=0</text>\n",
"<text x=\"53.5\" y=\"45\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M75,25 L125,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M80,40 L89,40 L103,10 L94,10 L80,40 L89,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"97\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M125,25 L140,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M160,25 L175,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M139,14 L161,14 L161,36 L139,36 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M143,27 C143.107,27.131,143.28,27.131,143.387,27 L145.692,24.179 C145.799,24.048,145.749,23.942,145.58,23.942 L144.36,23.942 C144.191,23.942,144.07600000000002,23.807,144.113,23.642 C144.742,20.776,147.3,18.624,150.353,18.624 C153.877,18.624,156.743,21.491,156.743,25.0142 C156.743,28.5372,153.877,31.4042,150.353,31.4042 C149.931,31.4042,149.58800000000002,31.746199999999998,149.58800000000002,32.1692 S149.93,32.9342,150.353,32.9342 C154.72,32.9342,158.27300000000002,29.382199999999997,158.27300000000002,25.014199999999995 C158.27300000000002,20.647199999999994,154.72100000000003,17.094199999999994,150.353,17.094199999999994 C146.455,17.094199999999994,143.207,19.926199999999994,142.554,23.640199999999993 C142.525,23.806199999999993,142.37,23.942199999999993,142.201,23.942199999999993 L141.0,23.942199999999993 C140.831,23.942199999999993,140.781,24.048199999999994,140.888,24.17919999999999 L143,27\" stroke-width=\"1\" stroke=\"black\" stroke-linejoin=\"miter\" fill=\"black\" />\n",
"<text x=\"150\" y=\"45\" font-size=\"7\" text-anchor=\"middle\">δ=pi/2</text>\n",
"<path d=\"M25,75 L75,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M38,57 L52,57 L52,93 L38,93 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M45,57 L45,93\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"53.5\" y=\"86\" font-size=\"7\" text-anchor=\"start\">ξ=0</text>\n",
"<text x=\"53.5\" y=\"95\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M75,75 L125,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M80,90 L89,90 L103,60 L94,60 L80,90 L89,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"97\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M125,75.0 L175,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M175,25.0 L190,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M175,75.0 L190,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<text x=\"200\" y=\"28.0\" font-size=\"6\" text-anchor=\"end\">0</text>\n",
"<text x=\"200\" y=\"78.0\" font-size=\"6\" text-anchor=\"end\">1</text>\n",
"<text x=\"0\" y=\"28.0\" font-size=\"6\" text-anchor=\"start\">0</text>\n",
"<text x=\"0\" y=\"78.0\" font-size=\"6\" text-anchor=\"start\">1</text>\n",
"</svg>"
],
"text/plain": [
"<drawsvg.drawing.Drawing at 0x26d3d147890>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def oracle(mark: int):\n",
" \"\"\"Values 0, 1, 2 and 3 for parameter 'mark' respectively mark the elements \"00\", \"01\", \"10\" and \"11\" of the list.\"\"\"\n",
" oracle_circuit = pcvl.Circuit(m=2, name='Oracle')\n",
" # The following dictionary translates n into the corresponding component settings\n",
" oracle_dict = {0: (1, 0), 1: (0, 1), 2: (1, 1), 3: (0, 0)}\n",
" PC_state, LC_state = oracle_dict[mark]\n",
" # Mode b\n",
" if PC_state == 1:\n",
" oracle_circuit //= HWP(0)\n",
" oracle_circuit.add(0, pcvl.PR(math.pi/2))\n",
" if LC_state == 1:\n",
" oracle_circuit //= HWP(0)\n",
" # Mode a\n",
" if LC_state == 1:\n",
" oracle_circuit //= (1, HWP(0))\n",
" if PC_state == 1:\n",
" oracle_circuit //= (1, HWP(0))\n",
" return oracle_circuit\n",
"\n",
"pcvl.pdisplay(oracle(0))"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "50596a16",
"metadata": {},
"source": [
"#### Inversion about mean"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "ef839994",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
" width=\"507.5\" height=\"156.25\" viewBox=\"-28.0 0 406.0 125.0\">\n",
"<defs>\n",
"</defs>\n",
"<path d=\"M10,25.0 L25,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,75.0 L25,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M25,25 L53,25 L72,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M78,44 L97,25 L125,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M25,75 L53,75 L72,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M78,56 L97,75 L125,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M50,43 L100,43 L100,57 L50,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"75\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"75\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M50,43 L100,43 L100,47 L50,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M93,50 L103,50 L103,60 L93,60 Z\" stroke=\"black\" fill=\"lightsalmon\" stroke-linejoin=\"miter\" />\n",
"<text x=\"98\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Ry</text>\n",
"<path d=\"M125,25 L175,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M138,7 L152,7 L152,43 L138,43 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M145,7 L145,43\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"153.5\" y=\"36\" font-size=\"7\" text-anchor=\"start\">ξ=pi/4</text>\n",
"<text x=\"153.5\" y=\"45\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M175,25 L225,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M180,40 L189,40 L203,10 L194,10 L180,40 L189,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"197\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M125,75.0 L225,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M225,25 L253,25 L272,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M278,44 L297,25 L325,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M225,75 L253,75 L272,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M278,56 L297,75 L325,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M250,43 L300,43 L300,57 L250,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"275\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"275\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M250,43 L300,43 L300,47 L250,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M293,50 L303,50 L303,60 L293,60 Z\" stroke=\"black\" fill=\"lightsalmon\" stroke-linejoin=\"miter\" />\n",
"<text x=\"298\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Ry</text>\n",
"<path d=\"M325,25.0 L340,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M325,75.0 L340,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<text x=\"350\" y=\"28.0\" font-size=\"6\" text-anchor=\"end\">0</text>\n",
"<text x=\"350\" y=\"78.0\" font-size=\"6\" text-anchor=\"end\">1</text>\n",
"<text x=\"0\" y=\"28.0\" font-size=\"6\" text-anchor=\"start\">0</text>\n",
"<text x=\"0\" y=\"78.0\" font-size=\"6\" text-anchor=\"start\">1</text>\n",
"</svg>"
],
"text/plain": [
"<drawsvg.drawing.Drawing at 0x26d3d5e8180>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"inversion_circuit = (pcvl.Circuit(m=2, name='Inversion')\n",
" // bsry\n",
" // HWP(math.pi / 4)\n",
" // bsry)\n",
"\n",
"pcvl.pdisplay(inversion_circuit)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "4daf70f2",
"metadata": {},
"source": [
"#### Detection\n",
"\n",
"The article also uses a detection circuit of the form:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "31ad50c7",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
" width=\"257.5\" height=\"281.25\" viewBox=\"-28.0 0 206.0 225.0\">\n",
"<defs>\n",
"</defs>\n",
"<path d=\"M10,25.0 L25,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,75.0 L25,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,125.0 L25,125.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,175.0 L25,175.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M25,25 L53,25 L62.5,37.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M87.5,37.5 L97,25 L125,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M25,75 L53,75 L62.5,62.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M87.5,62.5 L97,75 L125,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M87.5,62.5 L97,75 L125,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M50,50 L75,24 L100,50 L75,76 L50,50 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M50,50 L100,50\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"75\" y=\"86\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M25,125 L53,125 L62.5,137.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M87.5,137.5 L97,125 L125,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M25,175 L53,175 L62.5,162.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M87.5,162.5 L97,175 L125,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M87.5,162.5 L97,175 L125,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M50,150 L75,124 L100,150 L75,176 L50,150 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M50,150 L100,150\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"75\" y=\"186\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M125,25.0 L140,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M125,75.0 L140,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M125,125.0 L140,125.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M125,175.0 L140,175.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<text x=\"150\" y=\"28.0\" font-size=\"6\" text-anchor=\"end\">0</text>\n",
"<text x=\"150\" y=\"78.0\" font-size=\"6\" text-anchor=\"end\">1</text>\n",
"<text x=\"150\" y=\"128.0\" font-size=\"6\" text-anchor=\"end\">2</text>\n",
"<text x=\"150\" y=\"178.0\" font-size=\"6\" text-anchor=\"end\">3</text>\n",
"<text x=\"0\" y=\"28.0\" font-size=\"6\" text-anchor=\"start\">0</text>\n",
"<text x=\"0\" y=\"78.0\" font-size=\"6\" text-anchor=\"start\">1</text>\n",
"<text x=\"0\" y=\"128.0\" font-size=\"6\" text-anchor=\"start\">2</text>\n",
"<text x=\"0\" y=\"178.0\" font-size=\"6\" text-anchor=\"start\">3</text>\n",
"</svg>"
],
"text/plain": [
"<drawsvg.drawing.Drawing at 0x26d3d1eb950>"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"detection_circuit = pcvl.Circuit(m=4, name='Detection')\n",
"detection_circuit.add((0, 1), pcvl.PBS())\n",
"detection_circuit.add((2, 3), pcvl.PBS())\n",
"\n",
"pcvl.pdisplay(detection_circuit)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "76acc62f",
"metadata": {},
"source": [
"However, Perceval allows us to filter out the photon's polarization state, meaning that there is no need to expand the circuit to four output spatial modes.\n",
"\n",
"For now, we will need this particular circuit."
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "2326568e",
"metadata": {},
"source": [
"#### Final circuit setup \n",
"\n",
"As above, the value of parameter 'mark' indicates which element of the list needs to be found."
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "1b0bffde",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Grover optical circuit for searching database element \"00\":\n"
]
},
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
" width=\"1225.0\" height=\"281.25\" viewBox=\"-52.0 0 980.0 225.0\">\n",
"<defs>\n",
"</defs>\n",
"<path d=\"M10,25.0 L25,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,75.0 L25,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,125.0 L25,125.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,175.0 L25,175.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M27,2 L273,2 L273,98 L27,98 Z\" stroke=\"black\" fill=\"lightblue\" stroke-dasharray=\"1,2\" stroke-linejoin=\"miter\" />\n",
"<text x=\"29\" y=\"105\" font-size=\"8\" text-anchor=\"start\">INITIALIZATION</text>\n",
"<path d=\"M25,25 L75,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M38,7 L52,7 L52,43 L38,43 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M45,7 L45,43\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"53.5\" y=\"36\" font-size=\"7\" text-anchor=\"start\">ξ=pi/8</text>\n",
"<text x=\"53.5\" y=\"45\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M75,25 L125,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M80,40 L89,40 L103,10 L94,10 L80,40 L89,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"97\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M25,75.0 L125,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M125,25 L153,25 L172,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M178,44 L197,25 L225,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M125,75 L153,75 L172,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M178,56 L197,75 L225,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M150,43 L200,43 L200,57 L150,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"175\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"175\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M150,43 L200,43 L200,47 L150,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M193,50 L203,50 L203,60 L193,60 Z\" stroke=\"black\" fill=\"lightsalmon\" stroke-linejoin=\"miter\" />\n",
"<text x=\"198\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Ry</text>\n",
"<path d=\"M225,25 L275,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M230,40 L239,40 L253,10 L244,10 L230,40 L239,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"247\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=pi</text>\n",
"<path d=\"M225,75.0 L275,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M277,2 L423,2 L423,98 L277,98 Z\" stroke=\"black\" fill=\"lightblue\" stroke-dasharray=\"1,2\" stroke-linejoin=\"miter\" />\n",
"<text x=\"279\" y=\"105\" font-size=\"8\" text-anchor=\"start\">ORACLE</text>\n",
"<path d=\"M275,25 L325,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M288,7 L302,7 L302,43 L288,43 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M295,7 L295,43\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"303.5\" y=\"36\" font-size=\"7\" text-anchor=\"start\">ξ=0</text>\n",
"<text x=\"303.5\" y=\"45\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M325,25 L375,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M330,40 L339,40 L353,10 L344,10 L330,40 L339,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"347\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M375,25 L390,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M410,25 L425,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M389,14 L411,14 L411,36 L389,36 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M393,27 C393.10699999999997,27.131,393.28,27.131,393.387,27 L395.692,24.179 C395.799,24.048,395.749,23.942,395.58,23.942 L394.36,23.942 C394.19100000000003,23.942,394.076,23.807,394.113,23.642 C394.742,20.776,397.3,18.624,400.353,18.624 C403.877,18.624,406.743,21.491,406.743,25.0142 C406.743,28.5372,403.877,31.4042,400.353,31.4042 C399.931,31.4042,399.588,31.746199999999998,399.588,32.1692 S399.93,32.9342,400.353,32.9342 C404.72,32.9342,408.273,29.382199999999997,408.273,25.014199999999995 C408.273,20.647199999999994,404.721,17.094199999999994,400.353,17.094199999999994 C396.455,17.094199999999994,393.207,19.926199999999994,392.55400000000003,23.640199999999993 C392.52500000000003,23.806199999999993,392.37,23.942199999999993,392.201,23.942199999999993 L391.0,23.942199999999993 C390.831,23.942199999999993,390.781,24.048199999999994,390.888,24.17919999999999 L393,27\" stroke-width=\"1\" stroke=\"black\" stroke-linejoin=\"miter\" fill=\"black\" />\n",
"<text x=\"400\" y=\"45\" font-size=\"7\" text-anchor=\"middle\">δ=pi/2</text>\n",
"<path d=\"M275,75 L325,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M288,57 L302,57 L302,93 L288,93 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M295,57 L295,93\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"303.5\" y=\"86\" font-size=\"7\" text-anchor=\"start\">ξ=0</text>\n",
"<text x=\"303.5\" y=\"95\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M325,75 L375,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M330,90 L339,90 L353,60 L344,60 L330,90 L339,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"347\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M375,75.0 L425,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M427,2 L723,2 L723,98 L427,98 Z\" stroke=\"black\" fill=\"lightblue\" stroke-dasharray=\"1,2\" stroke-linejoin=\"miter\" />\n",
"<text x=\"429\" y=\"105\" font-size=\"8\" text-anchor=\"start\">INVERSION</text>\n",
"<path d=\"M425,25 L453,25 L472,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M478,44 L497,25 L525,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M425,75 L453,75 L472,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M478,56 L497,75 L525,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M450,43 L500,43 L500,57 L450,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"475\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"475\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M450,43 L500,43 L500,47 L450,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M493,50 L503,50 L503,60 L493,60 Z\" stroke=\"black\" fill=\"lightsalmon\" stroke-linejoin=\"miter\" />\n",
"<text x=\"498\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Ry</text>\n",
"<path d=\"M525,25 L575,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M538,7 L552,7 L552,43 L538,43 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M545,7 L545,43\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"553.5\" y=\"36\" font-size=\"7\" text-anchor=\"start\">ξ=pi/4</text>\n",
"<text x=\"553.5\" y=\"45\" font-size=\"7\" text-anchor=\"start\">δ=pi/2</text>\n",
"<path d=\"M575,25 L625,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M580,40 L589,40 L603,10 L594,10 L580,40 L589,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"597\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=3*pi/2</text>\n",
"<path d=\"M525,75.0 L625,75.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M625,25 L653,25 L672,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M678,44 L697,25 L725,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M625,75 L653,75 L672,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M678,56 L697,75 L725,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M650,43 L700,43 L700,57 L650,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"675\" y=\"85\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"675\" y=\"26\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M650,43 L700,43 L700,47 L650,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M693,50 L703,50 L703,60 L693,60 Z\" stroke=\"black\" fill=\"lightsalmon\" stroke-linejoin=\"miter\" />\n",
"<text x=\"698\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Ry</text>\n",
"<path d=\"M25,125.0 L725,125.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M728,75 L772,125\" stroke=\"white\" stroke-width=\"6\" fill=\"none\" />\n",
"<path d=\"M725,75 L728,75 L772,125 L775,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M728,125 L772,75\" stroke=\"white\" stroke-width=\"6\" fill=\"none\" />\n",
"<path d=\"M725,125 L728,125 L772,75 L775,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M777,2 L873,2 L873,198 L777,198 Z\" stroke=\"black\" fill=\"lightblue\" stroke-dasharray=\"1,2\" stroke-linejoin=\"miter\" />\n",
"<text x=\"779\" y=\"205\" font-size=\"8\" text-anchor=\"start\">DETECTION</text>\n",
"<path d=\"M725,25.0 L775,25.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M775,25 L803,25 L812.5,37.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M837.5,37.5 L847,25 L875,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M775,75 L803,75 L812.5,62.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M837.5,62.5 L847,75 L875,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M837.5,62.5 L847,75 L875,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M800,50 L825,24 L850,50 L825,76 L800,50 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M800,50 L850,50\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"825\" y=\"86\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M25,175.0 L775,175.0\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M775,125 L803,125 L812.5,137.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M837.5,137.5 L847,125 L875,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M775,175 L803,175 L812.5,162.5\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M837.5,162.5 L847,175 L875,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M837.5,162.5 L847,175 L875,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M800,150 L825,124 L850,150 L825,176 L800,150 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M800,150 L850,150\" stroke=\"black\" stroke-width=\"1\" fill=\"none\" />\n",
"<text x=\"825\" y=\"186\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<path d=\"M875,25.0 L890,25.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M875,75.0 L890,75.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M875,125.0 L890,125.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M875,175.0 L890,175.0\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<text x=\"900\" y=\"28.0\" font-size=\"6\" text-anchor=\"end\">0</text>\n",
"<text x=\"900\" y=\"78.0\" font-size=\"6\" text-anchor=\"end\">1</text>\n",
"<text x=\"900\" y=\"128.0\" font-size=\"6\" text-anchor=\"end\">2</text>\n",
"<text x=\"900\" y=\"178.0\" font-size=\"6\" text-anchor=\"end\">3</text>\n",
"<text x=\"0\" y=\"28.0\" font-size=\"6\" text-anchor=\"start\">0</text>\n",
"<text x=\"0\" y=\"78.0\" font-size=\"6\" text-anchor=\"start\">1</text>\n",
"<text x=\"0\" y=\"128.0\" font-size=\"6\" text-anchor=\"start\">2</text>\n",
"<text x=\"0\" y=\"178.0\" font-size=\"6\" text-anchor=\"start\">3</text>\n",
"</svg>"
],
"text/plain": [
"<drawsvg.drawing.Drawing at 0x26d3d59b2f0>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def grover_circuit(mark: int):\n",
" grover = pcvl.Circuit(m=4, name='Grover')\n",
" grover.add(0, init_circuit).add(0, oracle(mark)).add(0, inversion_circuit)\n",
" grover.add(1, pcvl.PERM([1, 0])).add(0, detection_circuit)\n",
" return grover\n",
"\n",
"print('Grover optical circuit for searching database element \"00\":')\n",
"pcvl.pdisplay(grover_circuit(0), recursive=True)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "922a8f12",
"metadata": {},
"source": [
"## Grover algorithm execution\n",
"\n",
"We can finally simulate Grover's algorithm for marked database elements \"00\", \"01\", \"10\" and \"11\"."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "0f000dac",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA1IAAAKHCAYAAACLonkvAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjEsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvc2/+5QAAAAlwSFlzAAAXEgAAFxIBZ5/SUgAAaNJJREFUeJzt3Qd4FFX79/E7AUIn9A4hIE2QDoKIdKV3RIqK2AUVURAUkKaoCIoiPKJSBKUqTZqUgHSRDkJ46C1U6R2y73Wf5538UzbJTrIJ2d3v57rW2czMzswuu2Z/Oefcx8/hcDgEAAAAAOAyf9d3BQAAAAAoghQAAAAA2ESQAgAAAACbCFIAAAAAYBNBCgAAAABsIkgBAAAAgE0EKQAAAACwiSAFAAAAADYRpAAAAADAJoIUAAAAANhEkAIAAAAAmwhSAAAAAGATQQoAAAAAbEpt9wFImLx588r169elcOHCD/pSAAAAAJ937NgxyZgxo5w+fTpBj6dFKploiLp796542jX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mxkrFRvdpvt888037jotAAAAAHhukJozZ45plWrQoEGs++i2ggULxlvZDwAAAAB8Ikj997//lTJlysS7X9myZc2+AAAAACC+HqQuX74sgYGB8e6n+1y8eNFdpwUAAAAAzw1S+fLlk507d8a7n+6j800BAAAAgPh6kKpXr57s3btXZsyYEes+M2fOlH/++Ufq1q3rrtMCAAAAgOcGqd69e0tAQIA899xz0qNHD9PydP36dXPT+7ru2WefNfvovgAAAAAgvh6kSpUqJT/99JOkSpVKxo0bJxUrVpQsWbKYm94fO3as2TZ58mRTcMIdbt68KQMHDpQSJUpIunTpJH/+/NKtWzc5efJkoo6rxTDSp08vfn5+cVYhBAAAAOCb3BakVPv27U3r06uvvioPPfSQpE2b1tz0/uuvvy47duyQDh06uOVct27dMt0Jhw4dKteuXZOWLVua8usTJ040we3QoUMJPvYrr7wit2/fdst1AgAAAPA+qd19QA1N2vqU1IYNGyYbN26UGjVqyB9//CGZMmUy60eNGiXvvvuuaZlatWqV7eP++OOP5nEapsaPH58EVw4AAADA07m1RSq53LlzR8aMGWPuf/vttxEhSvXq1UvKlSsnq1evli1bttg67pkzZ8z4rYYNG0rHjh3dft0AAAAAvIPbg9SFCxdk9OjR0rlzZ3nqqafk888/j9i2Z88emT9/vty4cSNR51i3bp2Zt6pYsWKmG1907dq1M8sFCxbYOu7bb79txl0lR4saAAAAAM/l1q59s2bNkpdeesmMWXI4HKZYQ4ECBSK2axGI1q1bm4ITXbp0SfB5dKyVqlSpktPt1npX5rWyLFq0yJRuHzJkiOmeeOLEiQRfHwAAAADv5rYWqQ0bNkinTp0kderUMnLkSPnrr79MmIqsfv36EhgYKL/99luiznXs2DGzLFiwoNPt1vqjR4+6dDwt0f7GG29IyZIl5f3330/UtQEAAADwfm5rkfrkk0/E399fli1bFmtLkZY/1227d+9O1Lm0xUtlyJDB6faMGTOa5dWrV106Xv/+/U3oCgkJMfNcJUaZMmWcrj948KDpiggAAADA87mtRWr9+vWmgl5sIcqSN29eCQsLk5Ti77//lq+//tp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FAAAAADYRJACAAAAAJsIUgAAAABgE0EKAAAAAGwiSAEAAACATQQpAAAAALCJIAUAAAAANhGkAAAAAMAmghQAAAAAiD3/D+XYdlkhgRpNAAAAAElFTkSuQmCC",
"text/plain": [
"<Figure size 960x720 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Circuit simulation\n",
"input_state = pcvl.BasicState(\"|{P:H},0, 0, 0>\")\n",
"results_list = [] # probability amplitudes storage\n",
"\n",
"for mark in range(4):\n",
" p = pcvl.Processor(\"SLOS\", grover_circuit(mark))\n",
" a = Analyzer(p, input_states=[input_state], output_states=states_modes)\n",
" results_list.append(a.distribution[0])\n",
"\n",
"# Plot data\n",
"labels = ['\"00\"', '\"01\"', '\"10\"', '\"11\"']\n",
"x = np.arange(4) # label locations\n",
" \n",
"fig, ax = plt.subplots(dpi=150)\n",
"for result, state in zip(results_list, states):\n",
" ax.bar(x, result.real, 0.1, label=str(state))\n",
"\n",
"ax.set_xlabel('Marked database element')\n",
"ax.set_ylabel('Detection probability') \n",
"ax.set_xticks(x, labels)\n",
"ax.legend()\n",
"ax.grid(True, axis='x')\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "659482dd",
"metadata": {},
"source": [
"As demonstrated by the graph above, Grover's algorithm indeed finds the marked database element!"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "d32d028f",
"metadata": {},
"source": [
"## Reference\n",
"\n",
"> Kwiat et al. Grover’s search algorithm: An optical approach. [Journal of Modern Optics](https://doi.org/10.1080/09500340008244040), 47(2–3), 257–266 (2000).\n"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
================================================
FILE: docs/source/notebooks/Advanced_state_tutorial.ipynb
================================================
{
"cells": [
{
"cell_type": "markdown",
"id": "6c48eed1a03dc991",
"metadata": {},
"source": [
"# Representing partially dinstinguishable states"
]
},
{
"cell_type": "markdown",
"id": "8dffc439586728bb",
"metadata": {},
"source": [
"In this notebook, we use the different kinds of `BasicState` to present how the user can handle complex inputs using perceval."
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "e372a8863b8965ff",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"from perceval import BasicState, AnnotatedFockState, StateVector, Annotation"
]
},
{
"cell_type": "markdown",
"id": "5df9f6df6986294d",
"metadata": {},
"source": [
"## BasicState insight"
]
},
{
"cell_type": "markdown",
"id": "84c4ba30e0915672",
"metadata": {},
"source": [
"A `BasicState` is a class that embodies three different kinds of Fock states. The class init chooses the correct representation according to its arguments, and most methods are common to all the classes.\n",
"\n",
"- The `FockState` represents indistinguishable photons. The representation shows the number of photon in each mode (e.g. $|0, 1, 0, 2\\rangle$)\n",
"- The `NoisyFockState` represents groups of indistinguishable photons, where each group is represented using an integer (the 'noise tag') from 0 to 255. The photons from different groups are totally distinguishable and do not interact at all. The representation shows the noise tag between brackets (e.g. $|0, \\{0\\}, 0, \\{0\\}\\{1\\}\\rangle$)\n",
"- The `AnnotatedFockState` is a generic state class where photons can be given string tags associated with values. The representation shows the tag and the value separated by a semicolon, all between brackets (e.g. $|0, \\{P:0\\}, 0, \\{P:1.57\\}\\{P:3.14\\}\\rangle$).\n",
"\n",
"In the general case, it is not possible to simulate the results of an `AnnotatedFockState`.\n",
"The user can provide a way to compute distinguishability from annotations comparison, which allows to handle some physical properties. Here we show an example of computations with photon wavelength, by converting an `AnnotatedFockState` into a superposition of `FockState` and `NoisyFockState`."
]
},
{
"cell_type": "markdown",
"id": "d6a007889e9cd8b",
"metadata": {},
"source": [
"## Example: wavelength\n",
"\n",
"Suppose you have two photons of different wavelength arriving at a perfect beam splitter. We want to study how a difference in wavelength will affect the HOM effect."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "initial_id",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"|{wavelength:6.25e-07},{wavelength:6.15e-07}>\n"
]
}
],
"source": [
"# This creates two AnnotatedFockStates with an associated wavelength\n",
"state_1 = BasicState(\"|{wavelength:625e-9}>\") # The first source produced state\n",
"state_2 = BasicState(\"|{wavelength:615e-9}>\") # The second source produced state\n",
"\n",
"# The whole input state arriving at the chip is then\n",
"input_state = state_1 * state_2\n",
"print(input_state)"
]
},
{
"cell_type": "markdown",
"id": "42647cee52df73e",
"metadata": {},
"source": [
"The problem now is that perceval doesn't know how distinguishable are these photons. So, as a user, we first need to convert this to something that Perceval can simulate.\n",
"\n",
"For that, we introduce a model where the indistinguishability depends on the wavelength of the two photons."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "6e3a20cceee955ff",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.999*|1,1>+0.032*|{0},{1}>\n"
]
}
],
"source": [
"def compute_indistinguishability(photon_1: Annotation, photon_2: Annotation):\n",
" # To make sense, this method must at least verify:\n",
" # - compute_indistinguishability(a, b) == compute_indistinguishability(b, a)\n",
" # - compute_indistinguishability(a, a) == 1\n",
" lambda_1 = photon_1[\"wavelength\"]\n",
" lambda_2 = photon_2[\"wavelength\"]\n",
" return np.exp(- 2 * (lambda_2 - lambda_1) ** 2 / (lambda_1 * lambda_2))\n",
"\n",
"def convert_state(state: AnnotatedFockState) -> StateVector:\n",
" assert state.n == 2 # This method would fail otherwise\n",
"\n",
" photon1 = state.get_photon_annotation(0) # Get the annotation from the first photon\n",
" photon2 = state.get_photon_annotation(1) # Get the annotation from the second photon\n",
"\n",
" indist = compute_indistinguishability(photon1, photon2)\n",
"\n",
" indist_state = state.clear_annotations() # This creates a FockState with photons at the same place\n",
" # Same result than BasicState(list(state))\n",
"\n",
" noise = (1 - indist ** 2) ** 0.5 # So the final result is normalized\n",
"\n",
" noisy_state = BasicState(list(state), [0, 1]) # Creates a NoisyFockState with tags 0 and 1 so the two photons are distinguishable\n",
"\n",
" return indist_state * indist + noisy_state * noise # Creates a StateVector containing only state types that Perceval can simulate\n",
"\n",
"converted_input_state = convert_state(input_state)\n",
"\n",
"print(converted_input_state)"
]
},
{
"cell_type": "markdown",
"id": "b802cc403ebce48d",
"metadata": {},
"source": [
"We can now simulate using our state as usual."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "d2fd16c1032d74e1",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\n",
"\t|0,2>: 0.4997399722916615\n",
"\t|2,0>: 0.4997399722916615\n",
"\t|1,1>: 0.0005200554166770454\n",
"}\n"
]
}
],
"source": [
"from perceval import BS, Processor\n",
"\n",
"p = Processor(\"SLAP\", BS())\n",
"p.min_detected_photons_filter(0)\n",
"p.with_input(converted_input_state)\n",
"\n",
"print(p.probs()[\"results\"])"
]
},
{
"cell_type": "markdown",
"id": "bf339ce618959ab5",
"metadata": {},
"source": [
"Great! You now know how to create and use states defining (partially) distinguishable photons.\n",
"Knowing how to use `BasicStates` that are more than just photon positions is a valuable tool for bigger and tougher problems, especially when state arithmetics is involved.\n",
"\n",
"The `AnnotatedFockState` can also be used to define polarization using the tag \"P\", that Perceval can natively handle, and that requires a more complex conversion (duplication of the circuit and state size, conversion back at the end...)"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
================================================
FILE: docs/source/notebooks/BS-based_implementation.ipynb
================================================
{
"cells": [
{
"cell_type": "markdown",
"id": "3d4fc10a",
"metadata": {},
"source": [
"# Error-tolerant BS-based circuit"
]
},
{
"cell_type": "markdown",
"id": "8cdc5601",
"metadata": {},
"source": [
"In this notebook, we aim at presenting an alternative form of \"generic\" interferometers using a BS-based structure as a building block rather than a MZI (Mach-Zehnder interferometer) as a building block. BS-based circuits seem to be more tolerant to manufacturing errors and losses according to Fldzhyan et al. *Optimal design of error-tolerant reprogrammable multiport interferometers*, [Optics Letters](https://doi.org/10.1364/OL.385433), 45(9):2632–2635 (2020)"
]
},
{
"cell_type": "markdown",
"id": "561b1415",
"metadata": {},
"source": [
"## Introduction "
]
},
{
"cell_type": "markdown",
"id": "94227072",
"metadata": {},
"source": [
"### Parameters"
]
},
{
"cell_type": "markdown",
"id": "897a99d7",
"metadata": {},
"source": [
"The goal is to successfully implement a random unitary $U_{target}$ by varying parameters of a fix \"generic\" interferometer $U_{interf}$. For instance, the Reck decomposition [2] has MZI as building block and by varying the angle of variable phase shifts, any unitary can be implemented. However, as we will see, this is only true when the MZI building block have perfect 50:50 beam-splitters which is not realistic in practice due to manufacturing errors. To see this, we will introduce a parameter $\\alpha$ which characterise the error caused by the imbalance of the static BS due to imperfect realisation. And we will investigate how this impacts the correct implementation of any unitary (drawn from the Haar measure) by minimising the infidelity (or maximising the fidelity) between the target unitary $U_{target}$ and its implementation $U_{interf}$.\n",
"We will compare this with the BS-based approach [1]."
]
},
{
"cell_type": "markdown",
"id": "5f57bc2b",
"metadata": {},
"source": [
"#### Initialisation"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "190e653d",
"metadata": {},
"outputs": [],
"source": [
"import datetime\n",
"import math\n",
"import os\n",
"import random\n",
"import time\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from scipy.optimize import basinhopping\n",
"from tqdm.notebook import tqdm_notebook\n",
"\n",
"import perceval as pcvl"
]
},
{
"cell_type": "markdown",
"id": "bcd40037",
"metadata": {},
"source": [
"We start by defining all parameters used in the program later on:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "09dfc317",
"metadata": {},
"outputs": [],
"source": [
"N=5\n",
"n_try=10\n",
"n_iter=3\n",
"n_process=8\n",
"angle_min=-15\n",
"angle_max=30\n",
"angle_step=2\n",
"n_unitary=300\n",
"logfilebs='bsbasednotebook-opt'\n",
"logfilemzi='mzibasednotebook-opt'"
]
},
{
"cell_type": "markdown",
"id": "98d2cc35",
"metadata": {},
"source": [
"## 1. Perceval implementation of the BS-based interferometer"
]
},
{
"cell_type": "markdown",
"id": "e6c9c678",
"metadata": {},
"source": [
"We start by describing the circuit as defined in [1] using `pcvl.GenericInterferometer()`. The circuit is built with an arrangement of single static beam-splitters with a variable phase shifter on the same leg. It also starts with phase-shifters on each mode at the beginning."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "0081f2c8",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n",
" width=\"2070.0\" height=\"343.75\" viewBox=\"-28.0 0 1656.0 275.0\">\n",
"<defs>\n",
"</defs>\n",
"<path d=\"M10,25 L25,25\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,75 L25,75\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,125 L25,125\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,175 L25,175\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M10,225 L25,225\" stroke-width=\"3\" stroke=\"darkred\" stroke-linejoin=\"miter\" fill=\"none\" />\n",
"<path d=\"M25,25 L75,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M30,40 L39,40 L53,10 L44,10 L30,40 L39,40 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"47\" y=\"38\" font-size=\"7\" text-anchor=\"start\">Φ=2.63925</text>\n",
"<path d=\"M25,75 L75,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M30,90 L39,90 L53,60 L44,60 L30,90 L39,90 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"47\" y=\"88\" font-size=\"7\" text-anchor=\"start\">Φ=0.199141</text>\n",
"<path d=\"M25,125 L75,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M30,140 L39,140 L53,110 L44,110 L30,140 L39,140 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"47\" y=\"138\" font-size=\"7\" text-anchor=\"start\">Φ=2.636975</text>\n",
"<path d=\"M25,175 L75,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M30,190 L39,190 L53,160 L44,160 L30,190 L39,190 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"47\" y=\"188\" font-size=\"7\" text-anchor=\"start\">Φ=0.975159</text>\n",
"<path d=\"M25,225 L75,225\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M30,240 L39,240 L53,210 L44,210 L30,240 L39,240 Z\" stroke=\"black\" fill=\"gray\" stroke-linejoin=\"miter\" />\n",
"<text x=\"47\" y=\"238\" font-size=\"7\" text-anchor=\"start\">Φ=3.854011</text>\n",
"<path d=\"M75,25 L103,25 L122,44\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M128,44 L147,25 L175,25\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M75,75 L103,75 L122,56\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M128,56 L147,75 L175,75\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M100,43 L150,43 L150,57 L100,57 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"125\" y=\"80\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"125\" y=\"26\" font-size=\"7\" text-anchor=\"middle\">Θ=theta_0</text>\n",
"<path d=\"M100,43 L150,43 L150,47 L100,47 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M143,50 L153,50 L153,60 L143,60 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
"<text x=\"148\" y=\"57\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
"<path d=\"M75,125 L103,125 L122,144\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M128,144 L147,125 L175,125\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M75,175 L103,175 L122,156\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M128,156 L147,175 L175,175\" stroke=\"darkred\" stroke-width=\"3\" fill=\"none\" />\n",
"<path d=\"M100,143 L150,143 L150,157 L100,157 Z\" stroke=\"black\" fill=\"black\" stroke-linejoin=\"miter\" />\n",
"<text x=\"125\" y=\"180\" font-size=\"7\" text-anchor=\"middle\"></text>\n",
"<text x=\"125\" y=\"126\" font-size=\"7\" text-anchor=\"middle\">Θ=theta_1</text>\n",
"<path d=\"M100,143 L150,143 L150,147 L100,147 Z\" stroke=\"black\" fill=\"lightgray\" stroke-linejoin=\"miter\" />\n",
"<path d=\"M143,150 L153,150 L153,160 L143,160 Z\" stroke=\"black\" fill=\"thistle\" stroke-linejoin=\"miter\" />\n",
"<text x=\"148\" y=\"157\" font-size=\"6\" text-anchor=\"middle\">Rx</text>\n",
"<path d=\"M17
gitextract_lva1xgfi/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ ├── rendering_requirements.txt
│ └── workflows/
│ ├── autotests.yml
│ ├── benchmarks.yml
│ ├── build-and-deploy-docs.yml
│ ├── python-publish.yml
│ ├── rerun-notebooks-and-build-docs.yml
│ └── rerun_notebooks.sh
├── .gitignore
├── .pre-commit-config.yaml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── benchmark/
│ ├── benchmark-circuit-building.py
│ ├── benchmark-unitary.py
│ ├── benchmark_QML-DE-solver.py
│ ├── benchmark_bosonsampling.py
│ ├── benchmark_pdisplay.py
│ └── benchmark_stepper.py
├── conftest.py
├── docs/
│ ├── Makefile
│ ├── make.bat
│ ├── multiversion_config/
│ │ └── conf.py
│ ├── requirements.txt
│ └── source/
│ ├── _static/
│ │ └── css/
│ │ └── style.css
│ ├── _templates/
│ │ ├── layout.html
│ │ ├── page.html
│ │ └── versions.html
│ ├── backends.rst
│ ├── bibliography.rst
│ ├── build_catalog.py
│ ├── conf.py
│ ├── contributing.rst
│ ├── examples_boson_sampling.rst
│ ├── examples_others.rst
│ ├── examples_quantum_walk.rst
│ ├── examples_standard_algo.rst
│ ├── examples_vqa.rst
│ ├── getting_started.rst
│ ├── index.rst
│ ├── legacy.rst
│ ├── notebooks/
│ │ ├── 2-mode_Grover_algorithm.ipynb
│ │ ├── Advanced_state_tutorial.ipynb
│ │ ├── BS-based_implementation.ipynb
│ │ ├── Boson_Bunching.ipynb
│ │ ├── Boson_sampling.ipynb
│ │ ├── Circuit_Tutorial.ipynb
│ │ ├── Computation_Tutorial.ipynb
│ │ ├── Density_matrix_Fock_space.ipynb
│ │ ├── Differential_equation_resolution.ipynb
│ │ ├── Encoding_Tutorial.ipynb
│ │ ├── Gedik_qudit.ipynb
│ │ ├── Graph_States_Tutorial.ipynb
│ │ ├── LOv_rewriting_rules.ipynb
│ │ ├── MPS_techniques_for_boson_sampling.ipynb
│ │ ├── QLOQ_QUBO_tutorial.ipynb
│ │ ├── QUBO.ipynb
│ │ ├── Quantum_teleportation_feed_forward.ipynb
│ │ ├── Reinforcement_learning.ipynb
│ │ ├── Remote_Computation_Tutorial.ipynb
│ │ ├── Shor_Implementation.ipynb
│ │ ├── Simulation_non-unitary_components.ipynb
│ │ ├── State_Tutorial.ipynb
│ │ ├── Tomography_walkthrough.ipynb
│ │ ├── Two-particle_bosonic-fermionic_quantum_walk.ipynb
│ │ ├── VQA_Tutorial.ipynb
│ │ ├── Variational_Quantum_Eigensolver.ipynb
│ │ ├── Walkthrough-cnot.ipynb
│ │ ├── quantum_kernel_methods.ipynb
│ │ └── requirements.txt
│ ├── reference/
│ │ ├── algorithm/
│ │ │ ├── analyzer.rst
│ │ │ ├── index.rst
│ │ │ ├── sampler.rst
│ │ │ └── tomography.rst
│ │ ├── backends/
│ │ │ ├── clifford2017.rst
│ │ │ ├── index.rst
│ │ │ ├── mps.rst
│ │ │ ├── naive.rst
│ │ │ ├── naive_approx.rst
│ │ │ ├── slap.rst
│ │ │ └── slos.rst
│ │ ├── components/
│ │ │ ├── catalog.rst
│ │ │ ├── circuit.rst
│ │ │ ├── detector.rst
│ │ │ ├── experiment.rst
│ │ │ ├── feed_forward_configurator.rst
│ │ │ ├── generic_interferometer.rst
│ │ │ ├── index.rst
│ │ │ ├── non_unitary_components.rst
│ │ │ ├── port.rst
│ │ │ ├── processor.rst
│ │ │ ├── source.rst
│ │ │ └── unitary_components.rst
│ │ ├── error_mitigation.rst
│ │ ├── exqalibur/
│ │ │ ├── circuit_optimizer.rst
│ │ │ ├── clifford2017.rst
│ │ │ ├── config.rst
│ │ │ ├── fockstate.rst
│ │ │ ├── fs_utils.rst
│ │ │ ├── index.rst
│ │ │ ├── permanent.rst
│ │ │ ├── postselect.rst
│ │ │ ├── slap.rst
│ │ │ ├── slos.rst
│ │ │ ├── source.rst
│ │ │ ├── state_data_structure.rst
│ │ │ └── statevector.rst
│ │ ├── providers.rst
│ │ ├── rendering/
│ │ │ ├── display_config.rst
│ │ │ ├── index.rst
│ │ │ ├── pdisplay.rst
│ │ │ └── skins.rst
│ │ ├── runtime/
│ │ │ ├── index.rst
│ │ │ ├── job.rst
│ │ │ ├── job_group.rst
│ │ │ ├── job_status.rst
│ │ │ ├── remote_config.rst
│ │ │ ├── remote_processor.rst
│ │ │ └── rpchandler.rst
│ │ ├── serialization.rst
│ │ ├── simulators/
│ │ │ ├── ff_simulator.rst
│ │ │ ├── index.rst
│ │ │ ├── noisy_sampling_simulator.rst
│ │ │ ├── simulator.rst
│ │ │ ├── simulator_factory.rst
│ │ │ └── stepper.rst
│ │ ├── utils/
│ │ │ ├── conversion.rst
│ │ │ ├── density_matrix.rst
│ │ │ ├── dist_metrics.rst
│ │ │ ├── distinct_permutations.rst
│ │ │ ├── expression.rst
│ │ │ ├── index.rst
│ │ │ ├── logging.rst
│ │ │ ├── logical_state.rst
│ │ │ ├── matrix.rst
│ │ │ ├── noise_model.rst
│ │ │ ├── parameter.rst
│ │ │ ├── persistent_data.rst
│ │ │ ├── polarization.rst
│ │ │ ├── random_seed.rst
│ │ │ ├── stategenerator.rst
│ │ │ └── states.rst
│ │ └── utils_algorithms/
│ │ ├── circuit_optimizer.rst
│ │ ├── index.rst
│ │ └── simplify.rst
│ ├── references.bib
│ ├── tutorial_advanced.rst
│ ├── tutorial_beginner.rst
│ └── tutorial_expert.rst
├── perceval/
│ ├── __init__.py
│ ├── algorithm/
│ │ ├── __init__.py
│ │ ├── abstract_algorithm.py
│ │ ├── analyzer.py
│ │ ├── sampler.py
│ │ └── tomography/
│ │ ├── __init__.py
│ │ ├── abstract_process_tomography.py
│ │ ├── tomography.py
│ │ ├── tomography_mle.py
│ │ └── tomography_utils.py
│ ├── backends/
│ │ ├── __init__.py
│ │ ├── _abstract_backends.py
│ │ ├── _clifford2017.py
│ │ ├── _mps.py
│ │ ├── _naive.py
│ │ ├── _naive_approx.py
│ │ ├── _slap.py
│ │ └── _slos.py
│ ├── components/
│ │ ├── __init__.py
│ │ ├── _decompose_perms.py
│ │ ├── _mode_connector.py
│ │ ├── _pauli.py
│ │ ├── abstract_component.py
│ │ ├── abstract_processor.py
│ │ ├── compiled_circuit.py
│ │ ├── component_catalog.py
│ │ ├── core_catalog/
│ │ │ ├── __init__.py
│ │ │ ├── _helpers/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── entanglement_qloq.py
│ │ │ │ └── rotations_qloq.py
│ │ │ ├── controlled_rotation_gates.py
│ │ │ ├── gates_1qubit.py
│ │ │ ├── generic_2mode.py
│ │ │ ├── heralded_cnot.py
│ │ │ ├── heralded_cz.py
│ │ │ ├── klm_cnot.py
│ │ │ ├── mzi.py
│ │ │ ├── postprocessed_ccz.py
│ │ │ ├── postprocessed_cnot.py
│ │ │ ├── postprocessed_cz.py
│ │ │ ├── qloq_ansatz.py
│ │ │ └── toffoli.py
│ │ ├── detector.py
│ │ ├── experiment.py
│ │ ├── feed_forward_configurator.py
│ │ ├── generic_interferometer.py
│ │ ├── linear_circuit.py
│ │ ├── non_unitary_components.py
│ │ ├── port.py
│ │ ├── processor.py
│ │ ├── source.py
│ │ ├── tomography_exp_configurer.py
│ │ └── unitary_components.py
│ ├── error_mitigation/
│ │ ├── __init__.py
│ │ ├── _loss_mitigation_utils.py
│ │ └── loss_mitigation.py
│ ├── providers/
│ │ ├── __init__.py
│ │ ├── quandela/
│ │ │ ├── __init__.py
│ │ │ └── quandela_session.py
│ │ └── scaleway/
│ │ ├── __init__.py
│ │ ├── scaleway_rpc_handler.py
│ │ └── scaleway_session.py
│ ├── rendering/
│ │ ├── __init__.py
│ │ ├── _density_matrix_utils.py
│ │ ├── _processor_utils.py
│ │ ├── canvas/
│ │ │ ├── __init__.py
│ │ │ ├── canvas.py
│ │ │ ├── latex_canvas.py
│ │ │ ├── mplot_canvas.py
│ │ │ └── svg_canvas.py
│ │ ├── circuit/
│ │ │ ├── __init__.py
│ │ │ ├── _canvas_shapes.py
│ │ │ ├── abstract_skin.py
│ │ │ ├── canvas_renderer.py
│ │ │ ├── create_renderer.py
│ │ │ ├── debug_skin.py
│ │ │ ├── display_config.py
│ │ │ ├── phys_skin.py
│ │ │ ├── renderer_interface.py
│ │ │ ├── skin_common.py
│ │ │ ├── symb_skin.py
│ │ │ └── text_renderer.py
│ │ ├── drawsvg_wrapper.py
│ │ ├── format.py
│ │ ├── mplotlib_renderers/
│ │ │ ├── __init__.py
│ │ │ ├── _mplot_utils.py
│ │ │ ├── density_matrix_renderer.py
│ │ │ ├── graph_renderer.py
│ │ │ └── tomography_renderer.py
│ │ └── pdisplay.py
│ ├── runtime/
│ │ ├── __init__.py
│ │ ├── check_cancel.py
│ │ ├── job.py
│ │ ├── job_group.py
│ │ ├── job_status.py
│ │ ├── local_job.py
│ │ ├── payload_generator.py
│ │ ├── remote_config.py
│ │ ├── remote_job.py
│ │ ├── remote_processor.py
│ │ ├── rpc_handler.py
│ │ └── session.py
│ ├── serialization/
│ │ ├── __init__.py
│ │ ├── _circuit_serialization.py
│ │ ├── _component_deserialization.py
│ │ ├── _constants.py
│ │ ├── _detector_serialization.py
│ │ ├── _experiment_serialization.py
│ │ ├── _matrix_serialization.py
│ │ ├── _parameter_serialization.py
│ │ ├── _port_deserialization.py
│ │ ├── _schema_circuit_pb2.py
│ │ ├── _serialized_containers.py
│ │ ├── _state_serialization.py
│ │ ├── deserialize.py
│ │ ├── perceval-serialization
│ │ ├── serialize.py
│ │ └── serialize_binary.py
│ ├── simulators/
│ │ ├── __init__.py
│ │ ├── _simulate_detectors.py
│ │ ├── _simulator_utils.py
│ │ ├── delay_simulator.py
│ │ ├── feed_forward_simulator.py
│ │ ├── loss_simulator.py
│ │ ├── noisy_sampling_simulator.py
│ │ ├── polarization_simulator.py
│ │ ├── simulator.py
│ │ ├── simulator_factory.py
│ │ ├── simulator_interface.py
│ │ └── stepper.py
│ └── utils/
│ ├── __init__.py
│ ├── _enums.py
│ ├── _random.py
│ ├── _validated_params.py
│ ├── algorithms/
│ │ ├── __init__.py
│ │ ├── circuit_optimizer.py
│ │ ├── decomposition.py
│ │ ├── match.py
│ │ ├── norm.py
│ │ ├── optimize.py
│ │ ├── simplification.py
│ │ └── solve.py
│ ├── conversion.py
│ ├── density_matrix.py
│ ├── density_matrix_utils.py
│ ├── dist_metrics.py
│ ├── format.py
│ ├── globals.py
│ ├── logging/
│ │ ├── __init__.py
│ │ ├── config.py
│ │ └── loggers.py
│ ├── logical_state.py
│ ├── matrix.py
│ ├── mlstr.py
│ ├── noise_model.py
│ ├── parameter.py
│ ├── persistent_data.py
│ ├── polarization.py
│ ├── postselect.py
│ ├── progress_cb.py
│ ├── qmath.py
│ ├── stategenerator.py
│ ├── states.py
│ └── versions/
│ ├── __init__.py
│ ├── metadata.py
│ └── version_utils.py
├── pyproject.toml
├── pytest.ini
├── requirements.txt
├── setup.py
└── tests/
├── __init__.py
├── _test_utils.py
├── algorithm/
│ ├── __init__.py
│ ├── test_analyzer.py
│ ├── test_sampler.py
│ ├── test_tomography.py
│ └── test_tomography_mle.py
├── backends/
│ ├── __init__.py
│ └── test_backends.py
├── components/
│ ├── __init__.py
│ ├── catalog/
│ │ ├── __init__.py
│ │ ├── test_1_qubit_gates.py
│ │ ├── test_2qbits_gates.py
│ │ ├── test_pauli.py
│ │ └── test_qloq.py
│ ├── test_circuit.py
│ ├── test_compiled_circuit.py
│ ├── test_compute_unitary.py
│ ├── test_controlled_gates.py
│ ├── test_decomposition.py
│ ├── test_detectors.py
│ ├── test_ff_configurator.py
│ ├── test_generic_interferometer.py
│ ├── test_loss_channel.py
│ ├── test_match.py
│ ├── test_mode_connector.py
│ ├── test_permutation.py
│ ├── test_port.py
│ ├── test_processor.py
│ ├── test_processor_composition.py
│ ├── test_source.py
│ ├── test_time_delay.py
│ ├── test_transfer.py
│ └── test_unitary_determinant.py
├── data/
│ ├── u_hom
│ ├── u_hom_sym
│ ├── u_random_2
│ ├── u_random_3
│ └── u_random_8
├── error_mitigation/
│ ├── __init__.py
│ └── test_loss_mitigation.py
├── rendering/
│ ├── __init__.py
│ ├── test_rendering.py
│ ├── test_visualization.py
│ └── test_visualization_ide.py
├── requirements.txt
├── runtime/
│ ├── __init__.py
│ ├── _mock_rpc_handler.py
│ ├── test_job.py
│ ├── test_job_group.py
│ ├── test_payload_generation.py
│ ├── test_remote_config.py
│ ├── test_remote_job.py
│ ├── test_rpc_handler.py
│ └── test_shots_estimate.py
├── serialization/
│ ├── __init__.py
│ ├── test_serialization.py
│ └── test_serialized_containers.py
├── simulators/
│ ├── __init__.py
│ ├── test_delay_simulator.py
│ ├── test_ff_simulator.py
│ ├── test_loss_simulator.py
│ ├── test_noisy_sampling_simulator.py
│ ├── test_polarization_simulator.py
│ ├── test_samples_provider.py
│ ├── test_simulate_detectors.py
│ ├── test_simulator.py
│ ├── test_simulator_factory.py
│ ├── test_simulator_utils.py
│ └── test_stepper.py
├── test_test_utils.py
└── utils/
├── __init__.py
├── test_circuit_optimizer.py
├── test_density_matrix.py
├── test_dist_metrics.py
├── test_doc_config.py
├── test_fidelity.py
├── test_format.py
├── test_log.py
├── test_logical_state.py
├── test_mask.py
├── test_matrix.py
├── test_metadata.py
├── test_mlstr.py
├── test_noise_model.py
├── test_optimize.py
├── test_parameter.py
├── test_persistent_data.py
├── test_polarization.py
├── test_postselect.py
├── test_qmath.py
├── test_seed.py
├── test_simplification.py
├── test_stategenerator.py
├── test_statevector.py
├── test_tensorproduct.py
└── test_utils_conversion.py
Showing preview only (225K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2651 symbols across 231 files)
FILE: benchmark/benchmark-unitary.py
function phase_shift (line 42) | def phase_shift(n_mode, theta):
FILE: benchmark/benchmark_QML-DE-solver.py
function F (line 42) | def F(u_prime, u, x): # DE: F(u_prime, u, x) = 0
function calc (line 81) | def calc(circuit, input_state, coefs):
function computation (line 87) | def computation(params):
function test_QML_DE_solver (line 140) | def test_QML_DE_solver(benchmark):
FILE: benchmark/benchmark_bosonsampling.py
function get_interferometer (line 35) | def get_interferometer(n):
function simulate_sampling (line 42) | def simulate_sampling(shots, circuit, input_state):
function test_bosonsampling_clifford_6 (line 50) | def test_bosonsampling_clifford_6(benchmark):
function test_bosonsampling_clifford_8 (line 55) | def test_bosonsampling_clifford_8(benchmark):
FILE: benchmark/benchmark_pdisplay.py
function generate_circuit (line 40) | def generate_circuit(n_mode):
function run_pdisplay (line 54) | def run_pdisplay(c, t, f):
function _run_pdisplay_mplot_6 (line 59) | def _run_pdisplay_mplot_6():
function _run_pdisplay_mplot_12 (line 63) | def _run_pdisplay_mplot_12():
function _run_pdisplay_svg_6 (line 67) | def _run_pdisplay_svg_6():
function _run_pdisplay_svg_12 (line 71) | def _run_pdisplay_svg_12():
function test_pdisplay_mplot_6 (line 75) | def test_pdisplay_mplot_6(benchmark):
function test_pdisplay_mplot_12 (line 79) | def test_pdisplay_mplot_12(benchmark):
function test_pdisplay_svg_6 (line 83) | def test_pdisplay_svg_6(benchmark):
function test_pdisplay_svg_12 (line 87) | def test_pdisplay_svg_12(benchmark):
FILE: benchmark/benchmark_stepper.py
function get_sample_from_statevector (line 47) | def get_sample_from_statevector(sv):
function run_stepper (line 59) | def run_stepper():
function run_direct (line 71) | def run_direct():
function test_stepper (line 101) | def test_stepper(benchmark):
function test_stepper_comp_direct (line 105) | def test_stepper_comp_direct(benchmark):
FILE: conftest.py
function pytest_addoption (line 4) | def pytest_addoption(parser):
function pytest_runtest_setup (line 11) | def pytest_runtest_setup(item):
FILE: docs/source/build_catalog.py
function get_pretty_string (line 33) | def get_pretty_string(s: str):
function build_catalog_rst (line 46) | def build_catalog_rst(path: str):
FILE: perceval/algorithm/abstract_algorithm.py
class AAlgorithm (line 33) | class AAlgorithm:
method __init__ (line 36) | def __init__(self, processor: AProcessor, **kwargs):
method _check_compatibility (line 53) | def _check_compatibility(self) -> bool:
FILE: perceval/algorithm/analyzer.py
class Analyzer (line 37) | class Analyzer(AAlgorithm):
method __init__ (line 52) | def __init__(self, processor: AProcessor,
method compute (line 108) | def compute(self, normalize: bool = False, expected: dict = None, prog...
method distribution (line 185) | def distribution(self) -> Matrix:
method col (line 194) | def col(self, output_state: BasicState) -> int | None:
FILE: perceval/algorithm/sampler.py
class Sampler (line 40) | class Sampler(AAlgorithm):
method __init__ (line 74) | def __init__(self, processor: AProcessor, **kwargs):
method _get_primitive_converter (line 79) | def _get_primitive_converter(self, method: str):
method _input_available (line 90) | def _input_available(self) -> bool:
method _check_sample_shot_iterator (line 101) | def _check_sample_shot_iterator(self) -> bool:
method _create_job (line 105) | def _create_job(self, method: str):
method samples (line 149) | def samples(self) -> Job:
method sample_count (line 157) | def sample_count(self) -> Job:
method probs (line 165) | def probs(self) -> Job:
method _add_iteration (line 173) | def _add_iteration(self, iter_params):
method _check_iteration (line 177) | def _check_iteration(self, iter_params):
method add_iteration (line 200) | def add_iteration(self, **kwargs):
method add_iteration_list (line 216) | def add_iteration_list(self, iterations: list[dict]):
method clear_iterations (line 224) | def clear_iterations(self):
method n_iterations (line 232) | def n_iterations(self):
method _probs_wrapper (line 235) | def _probs_wrapper(self, progress_callback: callable = None):
method _samples_wrapper (line 241) | def _samples_wrapper(self, max_samples: int = None, progress_callback:...
method _probs_iterate_locally (line 249) | def _probs_iterate_locally(self, max_shots: int = None, progress_callb...
method _samples_iterate_locally (line 263) | def _samples_iterate_locally(self, max_shots: int = None, max_samples:...
method _apply_iteration (line 284) | def _apply_iteration(self, it):
method _set_circuit_params (line 291) | def _set_circuit_params(self, params: dict):
method _set_input_state (line 298) | def _set_input_state(self, input_state: BasicState):
method _set_min_detected_photons (line 301) | def _set_min_detected_photons(self, count: int):
method _set_max_samples (line 304) | def _set_max_samples(self, val: int):
method _set_max_shots (line 307) | def _set_max_shots(self, val: int):
method _set_noise (line 310) | def _set_noise(self, noise: NoiseModel):
method _it_default_parameters (line 313) | def _it_default_parameters(self) -> dict:
FILE: perceval/algorithm/tomography/abstract_process_tomography.py
class AProcessTomography (line 37) | class AProcessTomography(AAlgorithm):
method __init__ (line 38) | def __init__(self, processor: AProcessor, **kwargs):
method chi_matrix (line 47) | def chi_matrix(self) -> np.ndarray:
method _beta_tensor_elem (line 50) | def _beta_tensor_elem(self, j: int, k: int, m: int, n: int, nqubit: in...
method _beta_as_matrix (line 67) | def _beta_as_matrix(self) -> np.ndarray:
method _lambda_target (line 82) | def _lambda_target(self, operator: np.ndarray) -> np.ndarray:
method chi_target (line 102) | def chi_target(self, operator: np.ndarray) -> np.ndarray:
FILE: perceval/algorithm/tomography/tomography.py
class StateTomography (line 43) | class StateTomography(AAlgorithm):
method __init__ (line 57) | def __init__(self, operator_processor: AProcessor, **kwargs):
method _stokes_parameter (line 71) | def _stokes_parameter(self, prep_state_indices: list, meas_pauli_basis...
method perform_state_tomography (line 106) | def perform_state_tomography(self, prep_state_indices: list) -> np.nda...
class ProcessTomography (line 125) | class ProcessTomography(AProcessTomography):
method __init__ (line 139) | def __init__(self, operator_processor: AProcessor, **kwargs):
method _lambda_vector (line 149) | def _lambda_vector(self) -> np.ndarray:
method chi_matrix (line 173) | def chi_matrix(self) -> np.ndarray:
method average_fidelity (line 189) | def average_fidelity(self, operator: np.ndarray) -> float:
method error_process_matrix (line 221) | def error_process_matrix(self, computed_chi: np.ndarray, operator: np....
FILE: perceval/algorithm/tomography/tomography_mle.py
class TomographyMLE (line 44) | class TomographyMLE(AAlgorithm):
method __init__ (line 51) | def __init__(self, operator_processor: AProcessor, **kwargs):
method _log_likelihood_func (line 75) | def _log_likelihood_func(self, *args, **kwargs) -> float:
method _grad_log_likelihood_func (line 79) | def _grad_log_likelihood_func(self, *args, **kwargs) -> np.ndarray:
method _povm_data (line 83) | def _povm_data(self):
method _collect_data (line 86) | def _collect_data(self, prep_state_indices, state_meas_indices) -> list:
method _povm_state (line 104) | def _povm_state(self) -> list:
method _povm_operator (line 135) | def _povm_operator(self) -> list:
method _input_basis (line 143) | def _input_basis(self) -> list:
method _proj_simplex (line 163) | def _proj_simplex(eigenvalues: list) -> list:
method _proj (line 178) | def _proj(h_matrix: np.ndarray) -> np.ndarray:
method _perform_mle_tomography (line 191) | def _perform_mle_tomography(self, init_guess_quantum_map: np.ndarray) ...
class StateTomographyMLE (line 243) | class StateTomographyMLE(TomographyMLE):
method __init__ (line 250) | def __init__(self, operator_processor, **kwargs):
method _povm_data (line 255) | def _povm_data(self):
method _log_likelihood_func (line 272) | def _log_likelihood_func(self, rho: np.ndarray) -> float:
method _grad_log_likelihood_func (line 284) | def _grad_log_likelihood_func(self, rho: np.ndarray) -> float:
method state_tomography_density_matrix (line 296) | def state_tomography_density_matrix(self) -> np.ndarray:
method state_fidelity (line 300) | def state_fidelity(target_state_dm: np.ndarray, computed_state_dm: np....
class ProcessTomographyMLE (line 312) | class ProcessTomographyMLE(TomographyMLE, AProcessTomography):
method __init__ (line 319) | def __init__(self, operator_processor, **kwargs):
method _povm_data (line 327) | def _povm_data(self):
method _log_likelihood_func (line 350) | def _log_likelihood_func(self, choi_matrix: np.ndarray) -> float:
method _grad_log_likelihood_func (line 366) | def _grad_log_likelihood_func(self, choi_matrix: np.ndarray) -> np.nda...
method chi_matrix (line 383) | def chi_matrix(self) -> np.ndarray:
FILE: perceval/algorithm/tomography/tomography_utils.py
function _compute_probs (line 39) | def _compute_probs(tomography_experiment, prep_state_indices: list, meas...
function _state_to_dens_matrix (line 75) | def _state_to_dens_matrix(state: np.ndarray) -> np.ndarray:
function _matrix_basis (line 85) | def _matrix_basis(nqubit: int, d: int) -> list:
function _matrix_to_vector (line 107) | def _matrix_to_vector(matrix: np.ndarray) -> np.ndarray:
function _vector_to_sq_matrix (line 116) | def _vector_to_sq_matrix(vector: np.ndarray) -> np.ndarray:
function _coef_linear_decomp (line 129) | def _coef_linear_decomp(matrix: np.ndarray, basis: list) -> np.ndarray:
function _get_fixed_basis_ops (line 146) | def _get_fixed_basis_ops(j: int, nqubit: int) -> np.ndarray:
function _get_canonical_basis_ops (line 173) | def _get_canonical_basis_ops(j: int, d: int) -> np.ndarray:
function _krauss_repr_ops (line 185) | def _krauss_repr_ops(m: int, rhoj: np.ndarray, n: int, nqubit: int) -> n...
function _generate_pauli_index (line 199) | def _generate_pauli_index(nqubit: int) -> list:
function _generate_pauli_prep_index (line 209) | def _generate_pauli_prep_index(nqubit: int, prep_basis_size: int = None)...
function _list_subset_k_from_n (line 226) | def _list_subset_k_from_n(k: int, n: int) -> list:
function is_physical (line 239) | def is_physical(input_matrix: np.ndarray, nqubit: int, eigen_tolerance: ...
function _index_num_to_basis (line 285) | def _index_num_to_basis(index, nqubit, basis_size) -> list:
function process_fidelity (line 293) | def process_fidelity(computed_map: np.ndarray, ideal_map: np.ndarray) ->...
FILE: perceval/backends/__init__.py
class BackendFactory (line 49) | class BackendFactory:
method get_backend (line 51) | def get_backend(backend_name: str = "SLOS", **kwargs) -> ABackend:
method list (line 61) | def list():
FILE: perceval/backends/_abstract_backends.py
class ABackend (line 39) | class ABackend(ABC):
method __init__ (line 40) | def __init__(self):
method set_circuit (line 45) | def set_circuit(self, circuit: ACircuit):
method set_input_state (line 56) | def set_input_state(self, input_state: FockState):
method _check_state (line 63) | def _check_state(self, state: FockState):
method name (line 69) | def name(self) -> str:
class ASamplingBackend (line 73) | class ASamplingBackend(ABackend):
method sample (line 75) | def sample(self) -> BasicState:
method samples (line 79) | def samples(self, count: int) -> BSSamples:
class _StateProbIterator (line 83) | class _StateProbIterator(Iterable[tuple[FockState, float]]):
method __init__ (line 85) | def __init__(self, states: Iterable[FockState], probs: Iterable[float]):
method __iter__ (line 89) | def __iter__(self):
class AStrongSimulationBackend (line 93) | class AStrongSimulationBackend(ABackend):
method __init__ (line 95) | def __init__(self):
method set_mask (line 103) | def set_mask(self, masks: str | list[str], n = None, at_least_modes = ...
method _init_mask (line 130) | def _init_mask(self):
method clear_mask (line 139) | def clear_mask(self):
method set_input_state (line 148) | def set_input_state(self, input_state: FockState):
method _get_iterator (line 152) | def _get_iterator(self, input_state: BasicState):
method clear_iterator_cache (line 160) | def clear_iterator_cache(self):
method set_circuit (line 163) | def set_circuit(self, circuit: ACircuit):
method prob_amplitude (line 169) | def prob_amplitude(self, output_state: FockState) -> complex:
method probability (line 173) | def probability(self, output_state: FockState) -> float:
method all_prob (line 177) | def all_prob(self, input_state: FockState = None) -> list[float]:
method prob_distribution (line 187) | def prob_distribution(self) -> BSDistribution:
method prob_iterator (line 197) | def prob_iterator(self, min_p: float = global_params["min_p"]) -> Iter...
method evolve (line 203) | def evolve(self) -> StateVector:
class IFFBackend (line 211) | class IFFBackend(ABC):
method can_simulate_feed_forward (line 215) | def can_simulate_feed_forward(components: list[tuple[tuple, AComponent]],
method set_feed_forward (line 227) | def set_feed_forward(self, components: list[tuple[tuple, AComponent]],...
FILE: perceval/backends/_clifford2017.py
class Clifford2017Backend (line 36) | class Clifford2017Backend(ASamplingBackend):
method __init__ (line 37) | def __init__(self):
method set_circuit (line 41) | def set_circuit(self, circuit: ACircuit):
method set_input_state (line 45) | def set_input_state(self, input_state: FockState):
method sample (line 49) | def sample(self):
method samples (line 52) | def samples(self, count: int):
method name (line 60) | def name(self) -> str:
FILE: perceval/backends/_mps.py
class MPSBackend (line 41) | class MPSBackend(AStrongSimulationBackend):
method __init__ (line 53) | def __init__(self, cutoff : int = None):
method name (line 68) | def name(self) -> str:
method set_cutoff (line 71) | def set_cutoff(self, cutoff_val: int):
method set_circuit (line 80) | def set_circuit(self, circuit: ACircuit):
method set_input_state (line 95) | def set_input_state(self, input_state: FockState):
method prob_amplitude (line 99) | def prob_amplitude(self, output_state: FockState) -> complex:
method _compile (line 122) | def _compile(self) -> bool:
method _apply (line 167) | def _apply(self, r, c):
method update_state_1_mode (line 185) | def update_state_1_mode(self, k, u):
method _transition_matrix_1_mode (line 196) | def _transition_matrix_1_mode(self, u):
method update_state_2_mode (line 213) | def update_state_2_mode(self, k, u):
method _transition_matrix_2_mode (line 282) | def _transition_matrix_2_mode(self, u):
method _sv_diag (line 309) | def _sv_diag(self, k):
FILE: perceval/backends/_naive.py
class NaiveBackend (line 38) | class NaiveBackend(AStrongSimulationBackend):
method name (line 43) | def name(self) -> str:
method prob_amplitude (line 46) | def prob_amplitude(self, output_state: FockState) -> complex:
method _compute_submatrix (line 51) | def _compute_submatrix(self, output_state: FockState) -> np.ndarray:
method _compute_permanent (line 70) | def _compute_permanent(self, m):
FILE: perceval/backends/_naive_approx.py
class NaiveApproxBackend (line 37) | class NaiveApproxBackend(NaiveBackend):
method __init__ (line 44) | def __init__(self, gurvits_iterations: int = 10000):
method name (line 49) | def name(self) -> str:
method _compute_permanent (line 52) | def _compute_permanent(self, m):
method prob_amplitude_with_error (line 56) | def prob_amplitude_with_error(self, output_state: FockState) -> tuple[...
method probability_confidence_interval (line 64) | def probability_confidence_interval(self, output_state: FockState) -> ...
FILE: perceval/backends/_slap.py
class SLAPBackend (line 38) | class SLAPBackend(AStrongSimulationBackend, IFFBackend):
method __init__ (line 40) | def __init__(self, mask=None):
method set_circuit (line 46) | def set_circuit(self, circuit: ACircuit):
method _init_mask (line 51) | def _init_mask(self):
method prob_amplitude (line 58) | def prob_amplitude(self, output_state: FockState) -> complex:
method prob_distribution (line 66) | def prob_distribution(self) -> BSDistribution:
method name (line 70) | def name(self) -> str:
method all_prob (line 73) | def all_prob(self, input_state: FockState = None):
method evolve (line 80) | def evolve(self) -> StateVector:
method can_simulate_feed_forward (line 89) | def can_simulate_feed_forward(components, input_state, detectors = Non...
method set_feed_forward (line 141) | def set_feed_forward(self, components: list[tuple[tuple, AComponent]],...
FILE: perceval/backends/_slos.py
class _Path (line 37) | class _Path:
method __init__ (line 40) | def __init__(self, n, m, states, targets, backend):
method _decompose (line 61) | def _decompose(self):
method compute (line 88) | def compute(self, u, parent_coefs: Matrix = None, mk: int = None):
class SLOSBackend (line 105) | class SLOSBackend(AStrongSimulationBackend):
method __init__ (line 106) | def __init__(self, mask=None, use_symbolic=False):
method name (line 114) | def name(self) -> str:
method _reset (line 117) | def _reset(self):
method _compute_path (line 126) | def _compute_path(self, umat):
method set_circuit (line 130) | def set_circuit(self, circuit):
method set_input_state (line 143) | def set_input_state(self, input_state: FockState):
method clear_mask (line 147) | def clear_mask(self):
method _deploy (line 151) | def _deploy(self, input_list: list[FockState]):
method preprocess (line 170) | def preprocess(self, input_list: list[FockState]) -> bool:
method prob_amplitude (line 187) | def prob_amplitude(self, output_state: FockState) -> complex:
method prob_distribution (line 195) | def prob_distribution(self) -> BSDistribution:
method all_prob (line 205) | def all_prob(self, input_state: FockState = None):
method evolve (line 216) | def evolve(self) -> StateVector:
FILE: perceval/components/_decompose_perms.py
function decompose_perms (line 34) | def decompose_perms(circuit: Circuit, merge: bool=True) -> Circuit:
FILE: perceval/components/_mode_connector.py
class UnavailableModeException (line 35) | class UnavailableModeException(Exception):
method __init__ (line 36) | def __init__(self, mode: int | list[int] | tuple[int], reason: str = N...
class InvalidMappingException (line 43) | class InvalidMappingException(Exception):
method __init__ (line 44) | def __init__(self, mapping: dict | list, reason: str = None):
class ModeConnector (line 51) | class ModeConnector:
method __init__ (line 58) | def __init__(self, left_experiment, right_obj, mapping):
method _mapping_type_checks (line 75) | def _mapping_type_checks(self):
method _get_ordered_rmodes (line 86) | def _get_ordered_rmodes(self):
method resolve (line 95) | def resolve(self) -> dict[int, int]:
method _check_consistency (line 172) | def _check_consistency(self):
method _resolve_port_left (line 188) | def _resolve_port_left(self, name: str):
method _resolve_port_right (line 204) | def _resolve_port_right(self, name: str):
method add_heralded_modes (line 221) | def add_heralded_modes(self, mapping):
method generate_permutation (line 236) | def generate_permutation(mode_mapping: dict[int, int]):
method compose_lists (line 255) | def compose_lists(self, mode_mapping: dict[int, int], l: list, r: list):
FILE: perceval/components/_pauli.py
class PauliType (line 37) | class PauliType(Enum):
class PauliEigenStateType (line 48) | class PauliEigenStateType(Enum):
function get_pauli_eigen_state_prep_circ (line 63) | def get_pauli_eigen_state_prep_circ(pauli_type: PauliEigenStateType) -> ...
function get_pauli_gate (line 94) | def get_pauli_gate(pauli_type: PauliType):
function get_pauli_eigenvectors (line 118) | def get_pauli_eigenvectors(pauli_type) -> list:
function get_pauli_eigenvector_matrix (line 144) | def get_pauli_eigenvector_matrix(pauli_eigenv) -> np.ndarray:
function get_pauli_basis_measurement_circuit (line 153) | def get_pauli_basis_measurement_circuit(pauli_type: PauliType) -> Circuit:
FILE: perceval/components/abstract_component.py
class AComponent (line 37) | class AComponent(ABC):
method __init__ (line 40) | def __init__(self, m: int, name: str = None):
method m (line 45) | def m(self) -> int:
method name (line 49) | def name(self) -> str:
method name (line 56) | def name(self, new_name: str = None) -> None:
method is_composite (line 60) | def is_composite(self) -> bool:
class AParametrizedComponent (line 67) | class AParametrizedComponent(AComponent):
method __init__ (line 68) | def __init__(self, m: int, name: str = None):
method vars (line 74) | def vars(self) -> dict[str, Parameter]:
method assign (line 80) | def assign(self,
method defined (line 97) | def defined(self) -> bool:
method params (line 107) | def params(self) -> Iterable[str]:
method param (line 113) | def param(self, param_name: str) -> Parameter:
method get_parameters (line 122) | def get_parameters(self, all_params: bool = False, expressions = False...
method reset_parameters (line 147) | def reset_parameters(self) -> None:
method _set_parameter (line 151) | def _set_parameter(self,
method _populate_parameters (line 186) | def _populate_parameters(self, out_parameters: dict, pname: str, defau...
method get_variables (line 210) | def get_variables(self):
method copy (line 213) | def copy(self):
FILE: perceval/components/abstract_processor.py
class ProcessorType (line 44) | class ProcessorType(Enum):
class AProcessor (line 49) | class AProcessor(ABC):
method __init__ (line 50) | def __init__(self, experiment = None):
method experiment (line 55) | def experiment(self) -> Experiment:
method experiment (line 59) | def experiment(self, experiment: Experiment):
method _circuit_change_observer (line 66) | def _circuit_change_observer(self, new_component = None):
method _noise_changed_observer (line 70) | def _noise_changed_observer(self):
method _input_changed_observer (line 73) | def _input_changed_observer(self):
method name (line 77) | def name(self) -> str:
method name (line 81) | def name(self, name: str):
method type (line 86) | def type(self) -> ProcessorType:
method is_remote (line 91) | def is_remote(self) -> bool:
method specs (line 95) | def specs(self):
method set_parameters (line 98) | def set_parameters(self, params: dict[str, any]):
method set_parameter (line 102) | def set_parameter(self, key: str, value: any):
method parameters (line 108) | def parameters(self):
method clear_parameters (line 111) | def clear_parameters(self):
method clear_input_and_circuit (line 114) | def clear_input_and_circuit(self, new_m=None):
method _min_detected_photons_filter (line 118) | def _min_detected_photons_filter(self):
method min_detected_photons_filter (line 121) | def min_detected_photons_filter(self, n: int):
method input_state (line 133) | def input_state(self):
method noise (line 137) | def noise(self):
method noise (line 141) | def noise(self, nm: NoiseModel):
method available_commands (line 146) | def available_commands(self) -> list[str]:
method remove_heralded_modes (line 149) | def remove_heralded_modes(self, s: FockState) -> FockState:
method post_select_fn (line 155) | def post_select_fn(self):
method set_postselection (line 158) | def set_postselection(self, postselect: PostSelect):
method clear_postselection (line 168) | def clear_postselection(self):
method compute_physical_logical_perf (line 172) | def compute_physical_logical_perf(self, value: bool):
method _state_selected (line 175) | def _state_selected(self, state: BasicState) -> bool:
method set_circuit (line 187) | def set_circuit(self, circuit: ACircuit) -> AProcessor:
method add (line 197) | def add(self, mode_mapping, component, keep_port: bool = True) -> APro...
method detectors (line 229) | def detectors(self):
method add_herald (line 232) | def add_herald(self, mode: int, expected: int, name: str = None, locat...
method components (line 245) | def components(self):
method m (line 249) | def m(self) -> int:
method m_in (line 256) | def m_in(self) -> int:
method m (line 264) | def m(self, value: int):
method circuit_size (line 268) | def circuit_size(self) -> int:
method linear_circuit (line 274) | def linear_circuit(self, flatten: bool = False) -> Circuit:
method non_unitary_circuit (line 281) | def non_unitary_circuit(self, flatten: bool = False) -> list[tuple[tup...
method get_circuit_parameters (line 284) | def get_circuit_parameters(self) -> dict[str, Parameter]:
method out_port_names (line 288) | def out_port_names(self):
method in_port_names (line 295) | def in_port_names(self):
method add_port (line 301) | def add_port(self, m, port: APort, location: PortLocation = PortLocati...
method remove_port (line 305) | def remove_port(self, m, location: PortLocation = PortLocation.IN_OUT):
method get_input_port (line 309) | def get_input_port(self, mode):
method get_output_port (line 312) | def get_output_port(self, mode):
method detection_type (line 316) | def detection_type(self) -> DetectionType:
method heralds (line 320) | def heralds(self):
method in_heralds (line 327) | def in_heralds(self):
method check_input (line 333) | def check_input(self, input_state: FockState):
method check_min_detected_photons_filter (line 337) | def check_min_detected_photons_filter(self):
method with_input (line 347) | def with_input(self, input_state: BasicState | LogicalState | StateVec...
method flatten (line 361) | def flatten(self, max_depth = None) -> list[tuple]:
FILE: perceval/components/compiled_circuit.py
class CompiledCircuit (line 34) | class CompiledCircuit(ACircuit):
method __init__ (line 35) | def __init__(self, name: str, template_or_size: ACircuit | int, parame...
method _compute_unitary (line 45) | def _compute_unitary(self,
method describe (line 61) | def describe(self) -> str:
method is_composite (line 72) | def is_composite(self) -> bool:
FILE: perceval/components/component_catalog.py
class CatalogItem (line 37) | class CatalogItem(ABC):
method __init__ (line 44) | def __init__(self, name: str):
method name (line 49) | def name(self) -> str:
method doc (line 57) | def doc(self):
method _handle_param (line 78) | def _handle_param(value):
method build_circuit (line 84) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 92) | def build_experiment(self, **kwargs) -> Experiment:
method build_processor (line 99) | def build_processor(self, **kwargs) -> Processor:
class Catalog (line 111) | class Catalog:
method __init__ (line 112) | def __init__(self, path: str):
method add_path (line 117) | def add_path(self, path):
method _add_sub_catalog (line 125) | def _add_sub_catalog(self, catalog):
method list (line 131) | def list(self) -> list[str]:
method __contains__ (line 134) | def __contains__(self, item: str) -> bool:
method __getitem__ (line 137) | def __getitem__(self, item_name: str) -> CatalogItem:
FILE: perceval/components/core_catalog/_helpers/entanglement_qloq.py
function generalized_cz (line 35) | def generalized_cz(n: int, m: int) -> Processor:
function generate_permutation_for_controlled_op (line 65) | def generate_permutation_for_controlled_op(control: int, target: int, nu...
function create_internal_controlled_op (line 88) | def create_internal_controlled_op(op_type: str, control: int, target: in...
function generate_chained_controlled_ops (line 113) | def generate_chained_controlled_ops(op_type: str, n: int) -> Circuit:
FILE: perceval/components/core_catalog/_helpers/rotations_qloq.py
function internal_swap (line 34) | def internal_swap(qubit1: int, qubit2: int, num_qubits: int) -> Circuit:
function _generate_rotation_kth_qubit (line 83) | def _generate_rotation_kth_qubit(gate_layer: Circuit, nqubits: int, k: i...
function _generate_rotation_last_qubit (line 102) | def _generate_rotation_last_qubit(gate: Circuit, nqubits: int) -> Circuit:
function _g_rn (line 110) | def _g_rn(gate_name: str, angle: float | Parameter, n: int ) -> Circuit:
function G_RHn (line 118) | def G_RHn(n: int) -> Circuit:
function G_RHk (line 123) | def G_RHk(n: int, k: int) -> Circuit:
function _g_rk (line 128) | def _g_rk(angle: float, n: int, k: int, rotation: str) -> Circuit:
function apply_rotations_to_qubits (line 132) | def apply_rotations_to_qubits(angle_list: list[float | Parameter], n: in...
FILE: perceval/components/core_catalog/controlled_rotation_gates.py
function build_control_gate_unitary (line 42) | def build_control_gate_unitary(n: int, alpha: float) -> Matrix:
class PostProcessedControlledRotationsItem (line 73) | class PostProcessedControlledRotationsItem(CatalogItem):
method __init__ (line 93) | def __init__(self):
method build_circuit (line 96) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 119) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/gates_1qubit.py
function _get_component_str_repr (line 45) | def _get_component_str_repr(repr_name: str) -> str:
class ASingleQubitGate (line 60) | class ASingleQubitGate(CatalogItem, ABC):
method __init__ (line 65) | def __init__(self):
method description (line 69) | def description(self):
method str_repr (line 73) | def str_repr(self):
method build_experiment (line 76) | def build_experiment(self, **kwargs) -> Experiment:
class AFixedItem (line 82) | class AFixedItem(ASingleQubitGate, ABC):
method build_circuit (line 85) | def build_circuit(self, **kwargs) -> Circuit:
class HadamardItem (line 89) | class HadamardItem(AFixedItem):
class SGateItem (line 96) | class SGateItem(AFixedItem):
class SDagGateItem (line 103) | class SDagGateItem(AFixedItem):
class TGateItem (line 110) | class TGateItem(AFixedItem):
class TDagGateItem (line 117) | class TDagGateItem(AFixedItem):
class APauliItem (line 124) | class APauliItem(AFixedItem, ABC):
method repr_name (line 128) | def repr_name(self):
method catalog_name (line 132) | def catalog_name(self):
method doc_name (line 136) | def doc_name(self):
class PauliXItem (line 140) | class PauliXItem(APauliItem):
class PauliYItem (line 145) | class PauliYItem(APauliItem):
class PauliZItem (line 150) | class PauliZItem(APauliItem):
class AParamItem (line 155) | class AParamItem(ASingleQubitGate, ABC):
method get_circuit (line 159) | def get_circuit(self, param) -> Circuit:
method build_circuit (line 162) | def build_circuit(self, **kwargs) -> Circuit:
class PhaseShiftItem (line 175) | class PhaseShiftItem(AParamItem):
method get_circuit (line 181) | def get_circuit(self, phi):
class ARItem (line 185) | class ARItem(AParamItem, ABC):
method repr_name (line 190) | def repr_name(self):
method catalog_name (line 194) | def catalog_name(self):
method doc_name (line 198) | def doc_name(self):
class RxItem (line 202) | class RxItem(ARItem):
method get_circuit (line 205) | def get_circuit(self, theta):
class RyItem (line 209) | class RyItem(ARItem):
method get_circuit (line 212) | def get_circuit(self, theta):
class RzItem (line 216) | class RzItem(ARItem):
method get_circuit (line 219) | def get_circuit(self, theta):
FILE: perceval/components/core_catalog/generic_2mode.py
class Generic2ModeItem (line 34) | class Generic2ModeItem(CatalogItem):
method __init__ (line 49) | def __init__(self):
method build_circuit (line 52) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 59) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/heralded_cnot.py
class HeraldedCnotItem (line 38) | class HeraldedCnotItem(CatalogItem):
method __init__ (line 50) | def __init__(self):
method build_circuit (line 53) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 61) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/heralded_cz.py
class HeraldedCzItem (line 37) | class HeraldedCzItem(CatalogItem):
method __init__ (line 51) | def __init__(self):
method build_circuit (line 54) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 74) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/klm_cnot.py
class KLMCnotItem (line 39) | class KLMCnotItem(CatalogItem):
method __init__ (line 58) | def __init__(self):
method build_circuit (line 61) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 80) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/mzi.py
class AMZI (line 38) | class AMZI(CatalogItem, ABC):
method _handle_params (line 48) | def _handle_params(**kwargs):
method build_experiment (line 57) | def build_experiment(self, **kwargs) -> Experiment:
method generate (line 60) | def generate(self, i: int):
class MZIPhaseFirst (line 69) | class MZIPhaseFirst(AMZI):
method __init__ (line 77) | def __init__(self):
method build_circuit (line 80) | def build_circuit(self, **kwargs) -> Circuit:
class MZIPhaseLast (line 86) | class MZIPhaseLast(AMZI):
method __init__ (line 94) | def __init__(self):
method build_circuit (line 97) | def build_circuit(self, **kwargs) -> Circuit:
class SymmetricMZI (line 103) | class SymmetricMZI(AMZI):
method __init__ (line 112) | def __init__(self):
method build_circuit (line 115) | def build_circuit(self, **kwargs) -> Circuit:
FILE: perceval/components/core_catalog/postprocessed_ccz.py
class PostProcessedCCZItem (line 38) | class PostProcessedCCZItem(CatalogItem):
method __init__ (line 52) | def __init__(self):
method build_circuit (line 55) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 59) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/postprocessed_cnot.py
class PostProcessedCnotItem (line 37) | class PostProcessedCnotItem(CatalogItem):
method __init__ (line 49) | def __init__(self):
method build_circuit (line 52) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 59) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/postprocessed_cz.py
class PostProcessedCzItem (line 35) | class PostProcessedCzItem(CatalogItem):
method __init__ (line 47) | def __init__(self):
method build_circuit (line 50) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 60) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/core_catalog/qloq_ansatz.py
class QLOQAnsatz (line 36) | class QLOQAnsatz(CatalogItem):
method __init__ (line 48) | def __init__(self):
method _apply_layer_operations (line 55) | def _apply_layer_operations(self, offset: int, size: int) -> None:
method _add_single_layer (line 69) | def _add_single_layer(self, offset: int, size: int, ctype: str):
method _build_qubit_circuit (line 78) | def _build_qubit_circuit(self, qubit_group_sizes: list[int], lp: list[...
method get_parameter_nb (line 128) | def get_parameter_nb(qubit_group_sizes: list[Encoding], nb_layers: int...
method build_circuit (line 151) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 186) | def build_experiment(self, **kwargs) -> Experiment:
method _generate_phases (line 208) | def _generate_phases(parameter_nb: int) -> list[str]:
FILE: perceval/components/core_catalog/toffoli.py
class ToffoliItem (line 35) | class ToffoliItem(CatalogItem):
method __init__ (line 47) | def __init__(self):
method build_circuit (line 50) | def build_circuit(self, **kwargs) -> Circuit:
method build_experiment (line 57) | def build_experiment(self, **kwargs) -> Experiment:
FILE: perceval/components/detector.py
class DetectionType (line 44) | class DetectionType(Enum):
class IDetector (line 59) | class IDetector(AComponent, ABC):
method __init__ (line 61) | def __init__(self):
method type (line 66) | def type(self) -> DetectionType:
method detect (line 72) | def detect(self, theoretical_photons: int) -> BSDistribution | FockState:
method copy (line 80) | def copy(self) -> IDetector:
method max_detections (line 85) | def max_detections(self):
method efficiency (line 90) | def efficiency(self):
class BSLayeredPPNR (line 94) | class BSLayeredPPNR(IDetector):
method __init__ (line 104) | def __init__(self, bs_layers: int, reflectivity: float = 0.5):
method max_detections (line 115) | def max_detections(self) -> int:
method type (line 120) | def type(self) -> DetectionType:
method efficiency (line 124) | def efficiency(self) -> float:
method clear_cache (line 127) | def clear_cache(self):
method create_circuit (line 134) | def create_circuit(self) -> Circuit:
method detect (line 147) | def detect(self, theoretical_photons: int) -> BSDistribution | FockState:
class Detector (line 169) | class Detector(IDetector):
method __init__ (line 199) | def __init__(self, n_wires: int = None, max_detections: int = None, wi...
method max_detections (line 213) | def max_detections(self) -> int:
method efficiency (line 218) | def efficiency(self):
method threshold (line 223) | def threshold() -> Detector:
method pnr (line 230) | def pnr() -> Detector:
method ppnr (line 237) | def ppnr(n_wires: int = None, max_detections: int = None, wire_efficie...
method type (line 244) | def type(self) -> DetectionType:
method detect (line 251) | def detect(self, theoretical_photons: int) -> BSDistribution | FockState:
method _cond_probability (line 278) | def _cond_probability(self, det: int, nph: int):
function get_detection_type (line 298) | def get_detection_type(detectors: list[IDetector]) -> DetectionType:
function check_heralds_detectors (line 320) | def check_heralds_detectors(heralds: dict[int, int] | None, detectors: l...
FILE: perceval/components/experiment.py
class _PhaseNoise (line 53) | class _PhaseNoise:
class Experiment (line 58) | class Experiment:
method __init__ (line 79) | def __init__(self, m_circuit: int | ACircuit = None, noise: NoiseModel...
method _reset_circuit (line 94) | def _reset_circuit(self):
method is_unitary (line 113) | def is_unitary(self) -> bool:
method has_td (line 120) | def has_td(self) -> bool:
method has_feedforward (line 127) | def has_feedforward(self) -> bool:
method _init_circuit (line 133) | def _init_circuit(self, m_circuit: ACircuit | int):
method clear_input_and_circuit (line 140) | def clear_input_and_circuit(self, new_m=None):
method _circuit_changed (line 149) | def _circuit_changed(self, component=None):
method add_observers (line 155) | def add_observers(self, circuit_observer: callable, noise_observer: ca...
method min_detected_photons_filter (line 160) | def min_detected_photons_filter(self, n: int):
method min_photons_filter (line 172) | def min_photons_filter(self):
method input_state (line 176) | def input_state(self):
method noise (line 180) | def noise(self):
method noise (line 184) | def noise(self, nm: NoiseModel | None):
method post_select_fn (line 199) | def post_select_fn(self):
method set_postselection (line 202) | def set_postselection(self, postselect: PostSelect):
method clear_postselection (line 215) | def clear_postselection(self):
method __deepcopy__ (line 220) | def __deepcopy__(self, memo):
method copy (line 234) | def copy(self) -> Experiment:
method set_circuit (line 242) | def set_circuit(self, circuit: ACircuit):
method add (line 257) | def add(self, mode_mapping, component, keep_port: bool = True):
method _add_ffconfig (line 318) | def _add_ffconfig(self, modes, component: AFFConfigurator):
method _add_detector (line 350) | def _add_detector(self, mode: int, detector: IDetector):
method detectors (line 364) | def detectors(self):
method _validate_postselect_composition (line 370) | def _validate_postselect_composition(self, mode_mapping: dict):
method _validate_new_parameters (line 377) | def _validate_new_parameters(self, new_params: dict[str, Parameter]):
method _compose_experiment (line 385) | def _compose_experiment(self, connector: ModeConnector, experiment: Ex...
method _add_component (line 527) | def _add_component(self, mode_mapping, component, keep_port: bool):
method _add_herald (line 552) | def _add_herald(self, mode, herald: Herald, location: PortLocation = P...
method add_herald (line 562) | def add_herald(self, mode: int, expected: int, name: str = None, locat...
method components (line 583) | def components(self):
method m (line 587) | def m(self) -> int:
method m_in (line 594) | def m_in(self):
method m (line 601) | def m(self, value: int):
method circuit_size (line 613) | def circuit_size(self) -> int:
method unitary_circuit (line 619) | def unitary_circuit(self, flatten: bool = False, use_phase_noise: bool...
method non_unitary_circuit (line 648) | def non_unitary_circuit(self, flatten: bool = False) -> list[tuple[tup...
method get_circuit_parameters (line 680) | def get_circuit_parameters(self) -> dict[str, Parameter]:
method out_port_names (line 685) | def out_port_names(self):
method in_port_names (line 696) | def in_port_names(self):
method add_port (line 706) | def add_port(self, m, port: APort, location: PortLocation = PortLocati...
method _find_and_remove_port_from_list (line 728) | def _find_and_remove_port_from_list(m, port_list) -> bool:
method remove_port (line 735) | def remove_port(self, m, location: PortLocation = PortLocation.IN_OUT):
method is_mode_connectible (line 745) | def is_mode_connectible(self, mode: int) -> bool:
method are_modes_free (line 752) | def are_modes_free(self, mode_range, location: PortLocation = PortLoca...
method get_input_port (line 766) | def get_input_port(self, mode):
method get_output_port (line 772) | def get_output_port(self, mode):
method detection_type (line 779) | def detection_type(self) -> DetectionType:
method heralds (line 783) | def heralds(self) -> dict[int, int]:
method in_heralds (line 787) | def in_heralds(self) -> dict[int, int]:
method check_input (line 790) | def check_input(self, input_state: FockState):
method _input_changed (line 797) | def _input_changed(self):
method with_input (line 804) | def with_input(self, input_state: LogicalState):
method with_input (line 811) | def with_input(self, input_state: FockState) -> None:
method with_input (line 827) | def with_input(self, input_state: AnnotatedFockState) -> None:
method with_input (line 835) | def with_input(self, sv: StateVector | NoisyFockState):
method with_input (line 844) | def with_input(self, svd: SVDistribution):
method flatten (line 856) | def flatten(self, max_depth=None) -> list[tuple]:
function _flatten (line 865) | def _flatten(composite, starting_mode=0, max_depth=None) -> list[tuple]:
FILE: perceval/components/feed_forward_configurator.py
class AFFConfigurator (line 39) | class AFFConfigurator(AParametrizedComponent, ABC):
method __init__ (line 55) | def __init__(self, m: int, offset: int, default_circuit: ACircuit, nam...
method block_circuit_size (line 62) | def block_circuit_size(self):
method configure (line 67) | def configure(self, measured_state: BasicState) -> ACircuit:
method circuit_template (line 78) | def circuit_template(self) -> ACircuit:
method config_modes (line 83) | def config_modes(self, self_modes: tuple[int, ...]) -> tuple[int, ...]:
method circuit_offset (line 98) | def circuit_offset(self):
method circuit_offset (line 102) | def circuit_offset(self, offset: int):
class FFCircuitProvider (line 107) | class FFCircuitProvider(AFFConfigurator):
method __init__ (line 125) | def __init__(self, m: int, offset: int, default_circuit: ACircuit, nam...
method _get_parameters (line 133) | def _get_parameters(circ, all_params: bool, expressions: bool) -> dict:
method reset_map (line 144) | def reset_map(self):
method circuit_map (line 150) | def circuit_map(self):
method circuit_map (line 154) | def circuit_map(self, circuit_map: dict[BasicState, ACircuit]):
method add_configuration (line 159) | def add_configuration(self, state, circuit: ACircuit) -> FFCircuitProv...
method configure (line 186) | def configure(self, measured_state: BasicState) -> ACircuit:
method circuit_template (line 189) | def circuit_template(self) -> ACircuit:
class FFConfigurator (line 193) | class FFConfigurator(AFFConfigurator):
method __init__ (line 213) | def __init__(self,
method _check_configuration (line 230) | def _check_configuration(self, config: dict[str, float]):
method add_configuration (line 238) | def add_configuration(self, detections: BasicState | tuple[int, ...], ...
method configure (line 246) | def configure(self, measured_state: BasicState) -> ACircuit:
method circuit_template (line 254) | def circuit_template(self) -> ACircuit:
FILE: perceval/components/generic_interferometer.py
class GenericInterferometer (line 39) | class GenericInterferometer(Circuit):
method __init__ (line 61) | def __init__(self,
method __repr__ (line 102) | def __repr__(self):
method mzi_depths (line 106) | def mzi_depths(self) -> list[int]:
method remove_phase_layer (line 110) | def remove_phase_layer(self):
method set_identity_mode (line 118) | def set_identity_mode(self):
method _add_single_mode_component (line 123) | def _add_single_mode_component(self, mode: int, component: ACircuit) -...
method _add_upper_component (line 132) | def _add_upper_component(self, i_depth: int) -> None:
method _add_lower_component (line 140) | def _add_lower_component(self, i_depth: int) -> None:
method _build_rectangle (line 150) | def _build_rectangle(self):
method _build_triangle (line 167) | def _build_triangle(self):
method _find_param_index (line 181) | def _find_param_index(self, col: int, lin: int, even_col_size: int, od...
method _compute_insertion_depth (line 191) | def _compute_insertion_depth(start_col: int, m: int, param_count: int)...
method set_param_list (line 201) | def set_param_list(self, param_list: list[float], top_left_pos: tuple[...
method set_params_from_other (line 236) | def set_params_from_other(self, other: Circuit, top_left_pos: tuple[in...
FILE: perceval/components/linear_circuit.py
class ACircuit (line 50) | class ACircuit(AParametrizedComponent, ABC):
method __init__ (line 57) | def __init__(self, m: int, name: str = None):
method _compute_unitary (line 61) | def _compute_unitary(self,
method compute_unitary (line 72) | def compute_unitary(self,
method requires_polarization (line 97) | def requires_polarization(self):
method U (line 105) | def U(self):
method definition (line 111) | def definition(self) -> Matrix:
method add (line 119) | def add(self, port_range: int | tuple[int, ...],
method __setitem__ (line 123) | def __setitem__(self, key, value):
method __ifloordiv__ (line 126) | def __ifloordiv__(self, component: ACircuit | tuple[int, ACircuit]) ->...
method __floordiv__ (line 143) | def __floordiv__(self, component: ACircuit | tuple[int, ACircuit]) -> ...
method __iter__ (line 154) | def __iter__(self):
method identify (line 164) | def identify(self, unitary_matrix, phases, precision=None, max_try=10,...
method _match_unitary (line 207) | def _match_unitary(circuit: ACircuit | Matrix, pattern: ACircuit, matc...
method match (line 258) | def match(self, pattern: ACircuit, pos: int = None,
method transfer_from (line 266) | def transfer_from(self, source: ACircuit, force: bool = False):
method depths (line 286) | def depths(self):
method ncomponents (line 292) | def ncomponents(self):
method inverse (line 298) | def inverse(self, v, h):
method describe (line 302) | def describe(self) -> str:
class Circuit (line 311) | class Circuit(ACircuit):
method __init__ (line 320) | def __init__(self, m: int, name: str = None):
method is_composite (line 325) | def is_composite(self):
method __iter__ (line 328) | def __iter__(self) -> Generator[tuple[tuple[int, ...], ACircuit]]:
method getitem (line 333) | def getitem(self, idx: tuple[int, int], only_parameterized: bool=False...
method get_parameters (line 357) | def get_parameters(self, all_params: bool = False, expressions = False...
method __getitem__ (line 374) | def __getitem__(self, idx) -> ACircuit:
method describe (line 383) | def describe(self) -> str:
method requires_polarization (line 399) | def requires_polarization(self) -> bool:
method definition (line 402) | def definition(self) -> Matrix:
method barrier (line 405) | def barrier(self):
method __imatmul__ (line 419) | def __imatmul__(self, component: ACircuit | tuple[int, ACircuit]) -> C...
method __matmul__ (line 428) | def __matmul__(self, component: ACircuit | tuple[int, ACircuit]) -> Ci...
method add (line 438) | def add(self, port_range: int | tuple[int, ...],
method _compute_unitary (line 482) | def _compute_unitary(self,
method _compute_circuit_unitary (line 487) | def _compute_circuit_unitary(self,
method inverse (line 505) | def inverse(self, v=False, h=False):
method compute_unitary (line 535) | def compute_unitary(self,
method copy (line 549) | def copy(self):
method decomposition (line 554) | def decomposition(U: MatrixN,
method depths (line 627) | def depths(self):
method ncomponents (line 635) | def ncomponents(self):
method transfer_from (line 641) | def transfer_from(self, source: ACircuit, force: bool = False):
method find_subnodes (line 658) | def find_subnodes(self, pos: int) -> list[int]:
method isolate (line 681) | def isolate(self, lc: list[int], name=None, color=None):
method replace (line 706) | def replace(self, p: int, pattern: ACircuit, merge: bool = False):
method _check_brother_node (line 719) | def _check_brother_node(self, p0, p1):
method match (line 728) | def match(self, pattern: ACircuit, pos: int = None,
FILE: perceval/components/non_unitary_components.py
class TD (line 36) | class TD(AParametrizedComponent):
method __init__ (line 48) | def __init__(self, dt: int | Parameter):
method get_variables (line 52) | def get_variables(self):
method describe (line 57) | def describe(self):
class LC (line 65) | class LC(AParametrizedComponent):
method __init__ (line 75) | def __init__(self, loss: float | Parameter):
method get_variables (line 79) | def get_variables(self):
method describe (line 84) | def describe(self):
method apply (line 91) | def apply(self, r, sv):
FILE: perceval/components/port.py
class PortLocation (line 36) | class PortLocation(Enum):
class APort (line 47) | class APort(AComponent, ABC):
method __init__ (line 48) | def __init__(self, size, name):
method supports_location (line 52) | def supports_location(loc: PortLocation) -> bool:
method output_mode_type (line 56) | def output_mode_type(self) -> ModeType:
method encoding (line 62) | def encoding(self) -> Encoding | None:
class Port (line 67) | class Port(APort):
method __init__ (line 74) | def __init__(self, encoding: Encoding, name: str):
method encoding (line 79) | def encoding(self):
method output_mode_type (line 82) | def output_mode_type(self) -> ModeType:
class Herald (line 86) | class Herald(APort):
method __init__ (line 94) | def __init__(self, value: int, name: str | int = None):
method output_mode_type (line 102) | def output_mode_type(self) -> ModeType:
method user_given_name (line 106) | def user_given_name(self):
method expected (line 113) | def expected(self):
function get_basic_state_from_ports (line 118) | def get_basic_state_from_ports(ports: list[APort], state: LogicalState, ...
function _to_fock (line 136) | def _to_fock(encoding: Encoding, qubit_state: list[int]) -> list[int]:
function get_basic_state_from_encoding (line 162) | def get_basic_state_from_encoding(encoding: list[Encoding | int], logica...
FILE: perceval/components/processor.py
class Processor (line 40) | class Processor(AProcessor):
method __init__ (line 59) | def __init__(self, backend, m_circuit: int | ACircuit | Experiment = N...
method _has_custom_input (line 76) | def _has_custom_input(self):
method _noise_changed_observer (line 80) | def _noise_changed_observer(self):
method noise (line 86) | def noise(self):
method source_distribution (line 93) | def source_distribution(self) -> SVDistribution | None:
method _circuit_change_observer (line 102) | def _circuit_change_observer(self, new_component = None):
method source (line 106) | def source(self):
method _init_backend (line 112) | def _init_backend(self, backend):
method type (line 122) | def type(self) -> ProcessorType:
method is_remote (line 126) | def is_remote(self) -> bool:
method _generate_noisy_input (line 129) | def _generate_noisy_input(self):
method generate_noisy_heralds (line 132) | def generate_noisy_heralds(self) -> SVDistribution:
method _input_changed_observer (line 138) | def _input_changed_observer(self):
method clear_input_and_circuit (line 147) | def clear_input_and_circuit(self, new_m=None):
method linear_circuit (line 151) | def linear_circuit(self, flatten: bool = False) -> Circuit:
method samples (line 162) | def samples(self, max_samples: int, max_shots: int = None, progress_ca...
method probs (line 185) | def probs(self, precision: float = None, progress_callback: callable =...
method available_commands (line 210) | def available_commands(self) -> list[str]:
method log_resources (line 214) | def log_resources(self, method: str, extra_parameters: dict):
method compute_physical_logical_perf (line 247) | def compute_physical_logical_perf(self, value: bool):
FILE: perceval/components/source.py
class Source (line 40) | class Source:
method __init__ (line 55) | def __init__(self,
method from_noise_model (line 75) | def from_noise_model(noise: NoiseModel):
method partially_distinguishable (line 85) | def partially_distinguishable(self):
method emission_probability (line 89) | def emission_probability(self):
method multiphoton_component (line 93) | def multiphoton_component(self):
method indistinguishability (line 97) | def indistinguishability(self):
method losses (line 101) | def losses(self):
method multiphoton_model (line 105) | def multiphoton_model(self):
method probability_distribution (line 108) | def probability_distribution(self, nphotons: int = 1, prob_threshold: ...
method generate_distribution (line 116) | def generate_distribution(self, expected_input: FockState, prob_thresh...
method create_iterator (line 136) | def create_iterator(self, expected_input: FockState, min_photons_filte...
method create_sampler (line 159) | def create_sampler(self, expected_input: FockState, min_photons_filter...
method generate_samples (line 167) | def generate_samples(self, max_samples: int, expected_input: FockState...
method generate_separated_samples (line 184) | def generate_separated_samples(self, max_samples: int, expected_input:...
method is_perfect (line 205) | def is_perfect(self) -> bool:
method __eq__ (line 208) | def __eq__(self, value: Source) -> bool:
method to_dict (line 211) | def to_dict(self) -> dict:
FILE: perceval/components/tomography_exp_configurer.py
function _prep_state_circuit_preparer (line 34) | def _prep_state_circuit_preparer(prep_state_indices: list):
function _meas_state_circuit_preparer (line 44) | def _meas_state_circuit_preparer(pauli_indices: list):
function processor_circuit_configurator (line 54) | def processor_circuit_configurator(processor, prep_state_indices: list, ...
FILE: perceval/components/unitary_components.py
class BSConvention (line 41) | class BSConvention(IntEnum):
class BS (line 48) | class BS(ACircuit):
method __init__ (line 61) | def __init__(self,
method name (line 77) | def name(self):
method convention (line 81) | def convention(self):
method H (line 86) | def H(theta=sp.pi/2, phi_tl=0, phi_bl=0, phi_tr=0, phi_br=0):
method Rx (line 94) | def Rx(theta=sp.pi / 2, phi_tl=0, phi_bl=0, phi_tr=0, phi_br=0):
method Ry (line 102) | def Ry(theta=sp.pi / 2, phi_tl=0, phi_bl=0, phi_tr=0, phi_br=0):
method r_to_theta (line 110) | def r_to_theta(r: float | Parameter) -> float | Expression:
method theta_to_r (line 122) | def theta_to_r(theta: float | Parameter) -> float | Expression:
method reflectivity (line 135) | def reflectivity(self):
method _compute_unitary (line 142) | def _compute_unitary(self, assign=None, use_symbolic=False):
method _matrix_template (line 174) | def _matrix_template(self, use_symbolic):
method get_variables (line 185) | def get_variables(self):
method describe (line 194) | def describe(self) -> str:
method inverse (line 199) | def inverse(self, v=False, h=False):
method definition (line 239) | def definition(self):
class PS (line 244) | class PS(ACircuit):
method __init__ (line 257) | def __init__(self, phi: Parameter | float, max_error: Parameter | floa...
method _compute_unitary (line 262) | def _compute_unitary(self, assign=None, use_symbolic=False):
method get_variables (line 273) | def get_variables(self):
method describe (line 280) | def describe(self):
method inverse (line 284) | def inverse(self, v=False, h=False):
method definition (line 291) | def definition(self) -> Matrix:
class WP (line 296) | class WP(ACircuit):
method __init__ (line 309) | def __init__(self, delta: float | Parameter, xsi: float | Parameter):
method _compute_unitary (line 314) | def _compute_unitary(self, assign=None, use_symbolic=False):
method get_variables (line 337) | def get_variables(self):
method describe (line 343) | def describe(self):
method inverse (line 347) | def inverse(self, v=False, h=False):
class HWP (line 351) | class HWP(WP):
method __init__ (line 358) | def __init__(self, xsi):
method definition (line 361) | def definition(self):
class QWP (line 365) | class QWP(WP):
method __init__ (line 372) | def __init__(self, xsi):
method definition (line 375) | def definition(self):
class PR (line 379) | class PR(ACircuit):
method __init__ (line 395) | def __init__(self, delta: float | Parameter):
method _compute_unitary (line 399) | def _compute_unitary(self, assign=None, use_symbolic=False):
method get_variables (line 410) | def get_variables(self):
method describe (line 415) | def describe(self):
method inverse (line 419) | def inverse(self, v: bool = False, h: bool = False):
class Unitary (line 423) | class Unitary(ACircuit):
method __init__ (line 432) | def __init__(self, U: Matrix, name: str = None, use_polarization: bool...
method _compute_unitary (line 445) | def _compute_unitary(self, assign: dict = None, use_symbolic: bool = F...
method inverse (line 449) | def inverse(self, v=False, h=False):
method describe (line 455) | def describe(self):
class PERM (line 464) | class PERM(Unitary):
method __init__ (line 475) | def __init__(self, perm: list[int]):
method describe (line 486) | def describe(self):
method definition (line 489) | def definition(self):
method perm_vector (line 493) | def perm_vector(self):
method apply (line 499) | def apply(self, r: tuple[int, ...], sv: BasicState | StateVector):
method break_in_2_mode_perms (line 525) | def break_in_2_mode_perms(self):
class PBS (line 551) | class PBS(Unitary):
method __init__ (line 566) | def __init__(self):
method describe (line 574) | def describe(self):
class Barrier (line 578) | class Barrier(ACircuit):
method __init__ (line 587) | def __init__(self, m: int, visible: bool = True):
method visible (line 593) | def visible(self):
method _compute_unitary (line 596) | def _compute_unitary(self, assign: dict = None, use_symbolic: bool = F...
method describe (line 599) | def describe(self):
method definition (line 602) | def definition(self):
method apply (line 606) | def apply(self, r, sv):
method inverse (line 609) | def inverse(self, v=False, h=False):
FILE: perceval/error_mitigation/_loss_mitigation_utils.py
function check_no_collision (line 38) | def check_no_collision(state) -> bool:
function _handle_zero_photon_lost_dist (line 43) | def _handle_zero_photon_lost_dist(noisy_distributions, pattern_map, nois...
function _handle_one_photon_lost_dist (line 48) | def _handle_one_photon_lost_dist(noisy_distributions, pattern_map, noisy...
function _handle_two_photons_lost_dist (line 57) | def _handle_two_photons_lost_dist(noisy_distributions, pattern_map, nois...
function _generate_one_photon_per_mode_mapping (line 71) | def _generate_one_photon_per_mode_mapping(m, n):
function _gen_lossy_dists (line 80) | def _gen_lossy_dists(noisy_input, ideal_photon_count, pattern_map):
function _get_avg_exp_from_uni_dist (line 108) | def _get_avg_exp_from_uni_dist(noisy_distributions, m, n):
FILE: perceval/error_mitigation/loss_mitigation.py
function _validate_noisy_input (line 37) | def _validate_noisy_input(noisy_input: BSCount | BSDistribution, ideal_p...
function photon_recycling (line 54) | def photon_recycling(noisy_input: BSCount | BSDistribution, ideal_photon...
FILE: perceval/providers/__init__.py
class ProviderFactory (line 42) | class ProviderFactory:
method get_provider (line 44) | def get_provider(provider_name: str, **kwargs) -> ISession:
method list (line 52) | def list():
FILE: perceval/providers/quandela/quandela_session.py
class Session (line 37) | class Session(ISession):
method __init__ (line 45) | def __init__(self, platform_name: str, token: str, url: str = None):
method build_remote_processor (line 51) | def build_remote_processor(self) -> RemoteProcessor:
FILE: perceval/providers/scaleway/scaleway_rpc_handler.py
class RPCHandler (line 47) | class RPCHandler:
method __init__ (line 50) | def __init__(
method name (line 73) | def name(self) -> str:
method url (line 77) | def url(self) -> str:
method headers (line 81) | def headers(self) -> dict:
method proxies (line 85) | def proxies(self) -> dict:
method fetch_platform_details (line 88) | def fetch_platform_details(self) -> dict:
method get_platform (line 91) | def get_platform(self, platform_name: str, provider_name: str) -> dict:
method create_session (line 113) | def create_session(
method terminate_session (line 156) | def terminate_session(self) -> None:
method delete_session (line 167) | def delete_session(self) -> None:
method create_job (line 180) | def create_job(self, payload: dict) -> str:
method cancel_job (line 210) | def cancel_job(self, job_id: str) -> None:
method rerun_job (line 219) | def rerun_job(self, job_id: str) -> str:
method get_job_status (line 229) | def get_job_status(self, job_id: str) -> dict:
method get_job_results (line 266) | def get_job_results(self, job_id: str) -> dict:
method __build_endpoint (line 314) | def __build_endpoint(self, endpoint) -> str:
method __to_date (line 317) | def __to_date(self, date: str) -> float | None:
method __get_duration (line 327) | def __get_duration(self, start_time: float | None) -> int | None:
FILE: perceval/providers/scaleway/scaleway_session.py
class Session (line 38) | class Session(ISession):
method __init__ (line 52) | def __init__(
method build_remote_processor (line 95) | def build_remote_processor(self) -> RemoteProcessor:
method start (line 98) | def start(self) -> None:
method stop (line 105) | def stop(self) -> None:
method delete (line 109) | def delete(self) -> None:
FILE: perceval/rendering/_density_matrix_utils.py
function _complex_to_rgb (line 37) | def _complex_to_rgb(z: complex, cmap='hsv'):
function _csr_to_rgb (line 46) | def _csr_to_rgb(matrix, cmap='hsv'):
function _csr_to_greyscale (line 64) | def _csr_to_greyscale(matrix):
function generate_ticks (line 82) | def generate_ticks(dm):
FILE: perceval/rendering/_processor_utils.py
class ComponentHeraldInfo (line 32) | class ComponentHeraldInfo:
method __init__ (line 37) | def __init__(self):
method register_herald (line 41) | def register_herald(self, forward_pass, mode_index, herald_mode):
function collect_herald_info (line 48) | def collect_herald_info(processor: Experiment, recursive: bool):
FILE: perceval/rendering/canvas/canvas.py
class Canvas (line 32) | class Canvas(ABC):
method __init__ (line 33) | def __init__(self, inverse_Y: bool = False, **opts):
method set_offset (line 46) | def set_offset(self, v: tuple[float, float], width: float, height: flo...
method position (line 53) | def position(self):
method relative_position (line 57) | def relative_position(self):
method position (line 61) | def position(self, v):
method height (line 73) | def height(self):
method width (line 76) | def width(self):
method add_mline (line 79) | def add_mline(self,
method add_polygon (line 100) | def add_polygon(self,
method add_rect (line 123) | def add_rect(self,
method add_mpath (line 134) | def add_mpath(self,
method add_circle (line 226) | def add_circle(self,
method add_text (line 248) | def add_text(self, points: tuple[float, float],
method normalize_text (line 264) | def normalize_text(self, text: str, size: float, points: tuple[float, ...
method add_shape (line 300) | def add_shape(self, shape_fn, circuit, mode_style):
method set_background_color (line 303) | def set_background_color(self, background_color):
method background_color (line 312) | def background_color(self):
method draw (line 315) | def draw(self):
FILE: perceval/rendering/canvas/latex_canvas.py
class LatexCanvas (line 68) | class LatexCanvas(Canvas):
method __init__ (line 69) | def __init__(self, **opts):
method _check_color_is_implemented (line 86) | def _check_color_is_implemented(self, color):
method add_mline (line 93) | def add_mline(
method add_polygon (line 113) | def add_polygon(
method add_mpath (line 138) | def add_mpath(
method add_circle (line 195) | def add_circle(
method add_text (line 212) | def add_text(self, points, text, size, ta="left", fontstyle="normal", ...
method draw (line 242) | def draw(self):
FILE: perceval/rendering/canvas/mplot_canvas.py
class MplotCanvas (line 41) | class MplotCanvas(Canvas):
method __init__ (line 42) | def __init__(self, **opts):
method add_mline (line 50) | def add_mline(self, points, stroke="black", stroke_width=1, stroke_lin...
method add_polygon (line 58) | def add_polygon(self, points, stroke="black", stroke_width=1, fill=Non...
method add_mpath (line 66) | def add_mpath(self, points, stroke="black", stroke_width=1, fill=None,...
method add_circle (line 94) | def add_circle(self, points, r, stroke="black", stroke_width=1, fill=N...
method add_text (line 101) | def add_text(self, points, text, size, ta="left", fontstyle="normal", ...
method draw (line 117) | def draw(self):
FILE: perceval/rendering/canvas/svg_canvas.py
class SvgCanvas (line 40) | class SvgCanvas(Canvas):
method __init__ (line 45) | def __init__(self, **opts):
method add_mline (line 55) | def add_mline(self, points, stroke="black", stroke_width=1, stroke_lin...
method add_polygon (line 61) | def add_polygon(self, points, stroke="black", stroke_width=1, fill=Non...
method add_mpath (line 70) | def add_mpath(self, points, stroke="black", stroke_width=1, fill=None,...
method add_circle (line 94) | def add_circle(self, points, r, stroke="black", stroke_width=1, fill=N...
method add_text (line 102) | def add_text(self, points, text, size, ta="start", fontstyle="normal",...
method draw (line 117) | def draw(self):
FILE: perceval/rendering/circuit/_canvas_shapes.py
class ShapeFactory (line 31) | class ShapeFactory:
method half_circle_port_in (line 53) | def half_circle_port_in(radius: float):
method half_circle_port_out (line 63) | def half_circle_port_out(radius: float, x_offset: float = 8):
method triangle_port_out (line 73) | def triangle_port_out(size: float, x_offset: float = 0):
method polygon_port_out (line 80) | def polygon_port_out(size: float, x_offset: float = 0):
method bs_symbolic_mpath (line 89) | def bs_symbolic_mpath(compact: bool):
method rounded_corner_square (line 111) | def rounded_corner_square(radius: float, length_ratio: float):
FILE: perceval/rendering/circuit/abstract_skin.py
class ASkin (line 38) | class ASkin(ABC):
method __init__ (line 55) | def __init__(self, photonic_style: dict, style_subcircuit: dict, compa...
method get_size (line 66) | def get_size(self, c: ACircuit, recursive: bool = False) -> tuple[int,...
method get_size (line 86) | def get_size(self, p: Experiment, recursive: bool = False) -> tuple[in...
method get_size (line 110) | def get_size(self, c: CompiledCircuit, recursive: bool = False) -> tup...
method measure (line 116) | def measure(self, c: AComponent) -> tuple[int, int]:
method get_width (line 125) | def get_width(self, c) -> int:
method get_shape (line 132) | def get_shape(self, c) -> callable:
method default_shape (line 139) | def default_shape(self, c, canvas, mode_style):
method _get_display_content (line 148) | def _get_display_content(self, circuit: ACircuit) -> str:
FILE: perceval/rendering/circuit/canvas_renderer.py
class _PortPos (line 38) | class _PortPos:
method __init__ (line 39) | def __init__(self, x, y):
class CanvasRenderer (line 44) | class CanvasRenderer(ICircuitRenderer):
method __init__ (line 50) | def __init__(self, nsize, canvas: Canvas, skin):
method open (line 72) | def open(self):
method get_circuit_size (line 83) | def get_circuit_size(self, circuit: ACircuit, recursive: bool = False)...
method display_input_photons (line 86) | def display_input_photons(self, input_pos: BasicState, mode_style: lis...
method add_mode_index (line 101) | def add_mode_index(self, input_mode_style = None):
method add_out_port (line 131) | def add_out_port(self, n_mode: int, port: APort):
method add_in_port (line 144) | def add_in_port(self, n_mode: int, port: APort):
method add_detectors (line 153) | def add_detectors(self, detector_list: list) -> None:
method open_subblock (line 167) | def open_subblock(self, lines: tuple[int, ...], name: str, size: tuple...
method close_subblock (line 201) | def close_subblock(self, lines: tuple[int, ...]):
method max_pos (line 208) | def max_pos(self, start, end, _=None):
method extend_pos (line 211) | def extend_pos(self, start, end, margin: int = 0):
method _add_shape (line 234) | def _add_shape(self, lines, circuit, w, shape_fn=None):
method set_herald_info (line 251) | def set_herald_info(self, info):
method _update_mode_style (line 254) | def _update_mode_style(self, lines, circuit, w: int):
method append_circuit (line 286) | def append_circuit(self, lines, circuit):
method append_subcircuit (line 293) | def append_subcircuit(self, lines, circuit):
method close (line 301) | def close(self):
method draw (line 319) | def draw(self):
class PreRenderer (line 323) | class PreRenderer(ICircuitRenderer):
method __init__ (line 331) | def __init__(self, nsize, skin):
method open (line 341) | def open(self):
method draw (line 344) | def draw(self):
method close (line 347) | def close(self):
method display_input_photons (line 350) | def display_input_photons(self, input_pos) -> None:
method add_mode_index (line 353) | def add_mode_index(self) -> None:
method add_out_port (line 356) | def add_out_port(self, m: int, port: APort) -> None:
method add_in_port (line 359) | def add_in_port(self, m: int, content: str) -> None:
method add_detectors (line 362) | def add_detectors(self, detector_list: list) -> None:
method set_herald_info (line 365) | def set_herald_info(self, info):
method get_circuit_size (line 368) | def get_circuit_size(self, circuit: ACircuit, recursive: bool = False):
method open_subblock (line 371) | def open_subblock(self, lines, name, size, color=None):
method close_subblock (line 378) | def close_subblock(self, lines):
method max_pos (line 387) | def max_pos(self, start, end, _=None):
method extend_pos (line 390) | def extend_pos(self, start: int, end: int, margin: int = 0):
method _add_shape (line 395) | def _add_shape(self, lines, circuit, w, shape_fn=None):
method _update_mode_style (line 398) | def _update_mode_style(self, lines, circuit, w: int):
method append_circuit (line 416) | def append_circuit(self, lines, circuit):
method append_subcircuit (line 424) | def append_subcircuit(self, lines, circuit):
FILE: perceval/rendering/circuit/create_renderer.py
class RendererFactory (line 40) | class RendererFactory:
method get_circuit_renderer (line 70) | def get_circuit_renderer(
method get_tomography_renderer (line 98) | def get_tomography_renderer(
method get_graph_renderer (line 110) | def get_graph_renderer(
method get_density_matrix_renderer (line 126) | def get_density_matrix_renderer(
FILE: perceval/rendering/circuit/debug_skin.py
class DebugSkin (line 33) | class DebugSkin(PhysSkin):
method __init__ (line 34) | def __init__(self, compact_display: bool = False):
method ps_shape (line 39) | def ps_shape(self, circuit: cp.PS, canvas, mode_style):
method barrier_shape (line 46) | def barrier_shape(self, circuit, canvas, mode_style):
FILE: perceval/rendering/circuit/display_config.py
function _get_default_skin (line 48) | def _get_default_skin():
class DisplayConfig (line 60) | class DisplayConfig:
method select_skin (line 68) | def select_skin(skin: type[ASkin]) -> None:
method get_selected_skin (line 76) | def get_selected_skin(**kwargs) -> ASkin:
method save (line 84) | def save() -> None:
FILE: perceval/rendering/circuit/phys_skin.py
class PhysSkin (line 43) | class PhysSkin(ASkin):
method __init__ (line 46) | def __init__(self, compact_display: bool = False):
method get_width (line 55) | def get_width(self, c) -> int:
method get_width (line 60) | def get_width(self, c) -> int:
method get_width (line 64) | def get_width(self, c) -> int:
method get_width (line 68) | def get_width(self, c) -> int:
method get_width (line 72) | def get_width(self, c) -> int:
method get_width (line 76) | def get_width(self, c) -> int:
method get_shape (line 80) | def get_shape(self, c):
method get_shape (line 84) | def get_shape(self, c):
method get_shape (line 88) | def get_shape(self, c):
method get_shape (line 92) | def get_shape(self, c):
method get_shape (line 96) | def get_shape(self, c):
method get_shape (line 100) | def get_shape(self, c):
method get_shape (line 104) | def get_shape(self, c):
method get_shape (line 108) | def get_shape(self, c):
method get_shape (line 112) | def get_shape(self, c):
method get_shape (line 116) | def get_shape(self, c):
method get_shape (line 120) | def get_shape(self, c):
method get_shape (line 124) | def get_shape(self, c):
method get_shape (line 128) | def get_shape(self, c):
method get_shape (line 132) | def get_shape(self, port, location):
method get_shape (line 138) | def get_shape(self, herald, location):
method get_shape (line 144) | def get_shape(self, detector):
method ffconf_shape (line 153) | def ffconf_shape(self, comp: AFFConfigurator, canvas, mode_style):
method port_shape_in (line 177) | def port_shape_in(self, port, canvas, mode_style):
method port_shape_out (line 182) | def port_shape_out(self, port, canvas, mode_style):
method pnr_detector_shape (line 187) | def pnr_detector_shape(self, detector, canvas, mode_style):
method threshold_detector_shape (line 195) | def threshold_detector_shape(self, detector, canvas, mode_style):
method ppnr_detector_shape (line 203) | def ppnr_detector_shape(self, detector, canvas, mode_style):
method default_shape (line 211) | def default_shape(self, circuit, canvas, mode_style):
method _reflective_side (line 223) | def _reflective_side(theta, convention: cp.BSConvention) -> int:
method bs_shape (line 240) | def bs_shape(self, bs, canvas, mode_style):
method ps_shape (line 268) | def ps_shape(self, circuit, canvas, mode_style):
method lc_shape (line 275) | def lc_shape(self, circuit, canvas, mode_style):
method pbs_shape (line 286) | def pbs_shape(self, circuit, canvas, mode_style):
method td_shape (line 297) | def td_shape(self, circuit, canvas, mode_style):
method unitary_shape (line 308) | def unitary_shape(self, circuit, canvas, mode_style):
method barrier_shape (line 315) | def barrier_shape(self, barrier, canvas, mode_style):
method perm_shape (line 328) | def perm_shape(self, circuit, canvas, mode_style):
method wp_shape (line 337) | def wp_shape(self, circuit, canvas, mode_style):
method pr_shape (line 346) | def pr_shape(self, circuit, canvas, mode_style):
method subcircuit_shape (line 354) | def subcircuit_shape(self, circuit, canvas, mode_style):
method herald_shape_in (line 363) | def herald_shape_in(self, herald, canvas, mode_style):
method herald_shape_out (line 369) | def herald_shape_out(self, herald, canvas, mode_style):
method comp_circuit_shape (line 383) | def comp_circuit_shape(self, circuit, canvas, mode_style):
FILE: perceval/rendering/circuit/renderer_interface.py
class ICircuitRenderer (line 36) | class ICircuitRenderer(ABC):
method __init__ (line 44) | def __init__(self, nsize):
method set_mode_style (line 57) | def set_mode_style(self, index, style):
method render_circuit (line 60) | def render_circuit(self,
method get_circuit_size (line 106) | def get_circuit_size(self, circuit: ACircuit, recursive: bool = False)...
method max_pos (line 112) | def max_pos(self, start, end) -> int:
method extend_pos (line 118) | def extend_pos(self, start: int, end: int, margin: int = 0) -> None:
method open (line 124) | def open(self) -> None:
method close (line 130) | def close(self) -> None:
method open_subblock (line 137) | def open_subblock(self, lines: tuple[int, ...], name: str, size: tuple...
method close_subblock (line 143) | def close_subblock(self, lines: tuple[int, ...]) -> None:
method draw (line 149) | def draw(self) -> any:
method append_subcircuit (line 156) | def append_subcircuit(self, lines: tuple[int, ...], circuit: Circuit) ...
method append_circuit (line 162) | def append_circuit(self, lines: tuple[int, ...], circuit: ACircuit) ->...
method add_mode_index (line 168) | def add_mode_index(self, input_mode_style = None) -> None:
method display_input_photons (line 174) | def display_input_photons(self, input_pos, mode_style: list[ModeType])...
method add_out_port (line 180) | def add_out_port(self, m: int, port: APort) -> None:
method add_in_port (line 186) | def add_in_port(self, m: int, port: APort) -> None:
method add_detectors (line 192) | def add_detectors(self, detector_list: list) -> None:
method set_herald_info (line 197) | def set_herald_info(self, info):
method subblock_info (line 206) | def subblock_info(self) -> dict:
FILE: perceval/rendering/circuit/skin_common.py
function bs_convention_color (line 40) | def bs_convention_color(convention):
FILE: perceval/rendering/circuit/symb_skin.py
class SymbSkin (line 41) | class SymbSkin(ASkin):
method __init__ (line 42) | def __init__(self, compact_display: bool = False):
method get_width (line 51) | def get_width(self, c) -> int:
method get_width (line 56) | def get_width(self, c) -> int:
method get_width (line 60) | def get_width(self, c) -> int:
method get_width (line 64) | def get_width(self, c) -> int:
method get_width (line 68) | def get_width(self, c: cp.Barrier) -> int:
method get_width (line 72) | def get_width(self, c) -> int:
method get_width (line 77) | def get_width(self, c) -> int:
method get_shape (line 81) | def get_shape(self, c):
method get_shape (line 85) | def get_shape(self, c):
method get_shape (line 89) | def get_shape(self, c):
method get_shape (line 93) | def get_shape(self, c):
method get_shape (line 97) | def get_shape(self, c):
method get_shape (line 101) | def get_shape(self, c):
method get_shape (line 105) | def get_shape(self, c):
method get_shape (line 109) | def get_shape(self, c):
method get_shape (line 113) | def get_shape(self, c):
method get_shape (line 117) | def get_shape(self, c):
method get_shape (line 121) | def get_shape(self, c):
method get_shape (line 125) | def get_shape(self, c):
method get_shape (line 129) | def get_shape(self, c):
method get_shape (line 133) | def get_shape(self, c):
method get_shape (line 137) | def get_shape(self, c):
method get_shape (line 141) | def get_shape(self, port, location):
method get_shape (line 147) | def get_shape(self, herald, location):
method ffconf_shape (line 152) | def ffconf_shape(self, comp: AFFConfigurator, canvas, mode_style):
method get_shape (line 177) | def get_shape(self, detector):
method default_shape (line 180) | def default_shape(self, circuit, canvas, mode_style):
method bs_shape (line 191) | def bs_shape(self, bs, canvas, mode_style):
method ps_shape (line 199) | def ps_shape(self, circuit, canvas, mode_style):
method lc_shape (line 205) | def lc_shape(self, circuit, canvas, mode_style):
method pbs_shape (line 216) | def pbs_shape(self, circuit, canvas, mode_style):
method td_shape (line 238) | def td_shape(self, circuit, canvas, mode_style):
method unitary_shape (line 249) | def unitary_shape(self, circuit, canvas, mode_style):
method barrier_shape (line 257) | def barrier_shape(self, barrier: cp.Barrier, canvas, mode_style):
method perm_shape (line 268) | def perm_shape(self, circuit, canvas, mode_style):
method wp_shape (line 279) | def wp_shape(self, circuit, canvas, mode_style):
method hwp_shape (line 287) | def hwp_shape(self, circuit, canvas, mode_style):
method qwp_shape (line 294) | def qwp_shape(self, circuit, canvas, mode_style):
method pr_shape (line 300) | def pr_shape(self, circuit, canvas, mode_style):
method subcircuit_shape (line 306) | def subcircuit_shape(self, circuit, canvas, mode_style):
method herald_shape_in (line 315) | def herald_shape_in(self, herald, canvas, mode_style):
method herald_shape_out (line 321) | def herald_shape_out(self, herald, canvas, mode_style):
method port_shape_in (line 327) | def port_shape_in(self, port, canvas, mode_style):
method port_shape_out (line 332) | def port_shape_out(self, port, canvas, mode_style):
method detector_shape (line 337) | def detector_shape(self, detector, canvas, mode_style):
method comp_circuit_shape (line 345) | def comp_circuit_shape(self, circuit, canvas, mode_style):
FILE: perceval/rendering/circuit/text_renderer.py
class TextRenderer (line 37) | class TextRenderer(ICircuitRenderer):
method __init__ (line 40) | def __init__(self, nsize, hc=3, min_box_size=5):
method get_circuit_size (line 50) | def get_circuit_size(self, circuit: ACircuit, recursive: bool = False):
method open (line 53) | def open(self):
method close (line 57) | def close(self):
method max_pos (line 62) | def max_pos(self, start, end, header=False):
method extend_pos (line 69) | def extend_pos(self, start, end, internal=False, header=False):
method open_subblock (line 78) | def open_subblock(self, lines, name, size, color=None):
method close_subblock (line 91) | def close_subblock(self, lines):
method append_subcircuit (line 104) | def append_subcircuit(self, lines, circuit):
method append_circuit (line 111) | def append_circuit(self, lines, circuit):
method draw (line 190) | def draw(self):
method _set_offset (line 193) | def _set_offset(self, offset):
method add_mode_index (line 201) | def add_mode_index(self, input_mode_style = None):
method display_input_photons (line 208) | def display_input_photons(self, input_pos, mode_style) -> None:
method add_out_port (line 211) | def add_out_port(self, n_mode: int, port: APort):
method add_in_port (line 219) | def add_in_port(self, n_mode: int, port: APort):
method add_detectors (line 235) | def add_detectors(self, detector_list: list) -> None:
FILE: perceval/rendering/drawsvg_wrapper.py
class DrawsvgWrapper (line 33) | class DrawsvgWrapper:
method __init__ (line 36) | def __init__(self, res: Any):
FILE: perceval/rendering/format.py
class Format (line 33) | class Format(Enum):
FILE: perceval/rendering/mplotlib_renderers/_mplot_utils.py
function autoselect_backend (line 39) | def autoselect_backend():
function _get_sub_figure (line 72) | def _get_sub_figure(ax: Axes3D, array: numpy.array, basis_name: list):
FILE: perceval/rendering/mplotlib_renderers/density_matrix_renderer.py
class DensityMatrixRenderer (line 34) | class DensityMatrixRenderer:
method __init__ (line 35) | def __init__(self,
method render (line 51) | def render(self, dm):
FILE: perceval/rendering/mplotlib_renderers/graph_renderer.py
class GraphRenderer (line 34) | class GraphRenderer:
method __init__ (line 35) | def __init__(self):
method render (line 38) | def render(self, g: nx.Graph):
FILE: perceval/rendering/mplotlib_renderers/tomography_renderer.py
function _generate_pauli_captions (line 39) | def _generate_pauli_captions(nqubit: int):
class TomographyRenderer (line 51) | class TomographyRenderer:
method __init__ (line 52) | def __init__(self, render_size, mplot_noshow: bool, mplot_savefig: str):
method render (line 57) | def render(self, qpt: AProcessTomography, precision: float):
FILE: perceval/rendering/pdisplay.py
function in_ide (line 56) | def in_ide():
function pdisplay_circuit (line 76) | def pdisplay_circuit(
function pdisplay_processor (line 105) | def pdisplay_processor(processor: AProcessor,
function pdisplay_experiment (line 116) | def pdisplay_experiment(processor: Experiment,
function pdisplay_matrix (line 212) | def pdisplay_matrix(matrix: Matrix, precision: float = 1e-6, output_form...
function pdisplay_analyzer (line 257) | def pdisplay_analyzer(analyzer: Analyzer, output_format: Format = Format...
function pdisplay_state_distrib (line 269) | def pdisplay_state_distrib(sv: StateVector | BSDistribution | SVDistribu...
function pdisplay_bs_samples (line 312) | def pdisplay_bs_samples(bs_samples: BSSamples, output_format: Format = F...
function pdisplay_tomography_chi (line 318) | def pdisplay_tomography_chi(qpt: AProcessTomography, output_format: Form...
function pdisplay_density_matrix (line 324) | def pdisplay_density_matrix(dm,
function pdisplay_graph (line 342) | def pdisplay_graph(g: nx.Graph, output_format: Format = Format.MPLOT):
function pdisplay_job_group (line 347) | def pdisplay_job_group(jg: JobGroup, output_format: Format = Format.TEXT):
function _pdisplay (line 359) | def _pdisplay(o, **kwargs):
function _pdisplay (line 363) | def _pdisplay(dm, **kwargs):
function _pdisplay (line 367) | def _pdisplay(qpt, **kwargs):
function _pdisplay (line 372) | def _pdisplay(jg, **kwargs):
function _pdisplay (line 377) | def _pdisplay(circuit, **kwargs):
function _pdisplay (line 382) | def _pdisplay(processor, **kwargs):
function _pdisplay (line 387) | def _pdisplay(experiment, **kwargs):
function _pdisplay (line 392) | def _pdisplay(matrix, **kwargs):
function _pdisplay (line 397) | def _pdisplay(analyzer, **kwargs):
function _pdisplay (line 402) | def _pdisplay(distrib, **kwargs):
function _pdisplay (line 410) | def _pdisplay(bsc, **kwargs):
function _pdisplay (line 415) | def _pdisplay(bssamples, **kwargs):
function _get_simple_number_kwargs (line 419) | def _get_simple_number_kwargs(**kwargs):
function _pdisplay (line 428) | def _pdisplay(f, **kwargs):
function _pdisplay (line 433) | def _pdisplay(c, **kwargs):
function _pdisplay (line 437) | def _pdisplay(g, **kwargs):
function _default_output_format (line 441) | def _default_output_format(o):
function pdisplay (line 454) | def pdisplay(o, output_format: Format = None, **opts):
function pdisplay_to_file (line 502) | def pdisplay_to_file(o, path: str, output_format: Format = None, **opts):
FILE: perceval/runtime/check_cancel.py
function cancel_requested (line 30) | def cancel_requested(exec_request: dict = None):
FILE: perceval/runtime/job.py
class Job (line 38) | class Job(ABC):
method __init__ (line 39) | def __init__(self, result_mapping_function: callable = None, command_p...
method name (line 46) | def name(self) -> str:
method name (line 53) | def name(self, new_name: str):
method delta_parameters (line 60) | def delta_parameters(self) -> dict:
method _handle_params (line 63) | def _handle_params(self, *args, **kwargs):
method __call__ (line 87) | def __call__(self, *args, **kwargs) -> dict:
method status (line 95) | def status(self) -> JobStatus:
method is_complete (line 101) | def is_complete(self) -> bool:
method is_failed (line 105) | def is_failed(self) -> bool:
method is_success (line 109) | def is_success(self) -> bool:
method is_waiting (line 113) | def is_waiting(self) -> bool:
method is_running (line 117) | def is_running(self) -> bool:
method execute_sync (line 121) | def execute_sync(self, *args, **kwargs) -> dict:
method execute_async (line 125) | def execute_async(self, *args, **kwargs) -> Job:
method cancel (line 137) | def cancel(self):
method _get_results (line 143) | def _get_results(self):
method get_results (line 146) | def get_results(self) -> dict:
FILE: perceval/runtime/job_group.py
class JobGroup (line 48) | class JobGroup:
method __init__ (line 66) | def __init__(self, name: str):
method __len__ (line 81) | def __len__(self):
method __getitem__ (line 84) | def __getitem__(self, index):
method name (line 88) | def name(self) -> str:
method remote_jobs (line 95) | def remote_jobs(self) -> list[RemoteJob]:
method _to_json (line 101) | def _to_json(self) -> dict:
method _from_json (line 110) | def _from_json(self, json_data: dict) -> None:
method _write_to_file (line 116) | def _write_to_file(self) -> None:
method _load_job_group (line 123) | def _load_job_group(self) -> None:
method _build_remote_job (line 131) | def _build_remote_job(job_entry: dict) -> RemoteJob:
method list_locally_saved (line 141) | def list_locally_saved() -> list[str]:
method _exists_on_disk (line 150) | def _exists_on_disk(name: str) -> bool:
method add (line 156) | def add(self, job_to_add: Job, **kwargs) -> None:
method _update_job_statuses (line 176) | def _update_job_statuses(self):
method progress (line 187) | def progress(self) -> dict:
method track_progress (line 231) | def track_progress(self) -> None:
method delete_all_job_groups (line 283) | def delete_all_job_groups() -> None:
method delete_job_group (line 291) | def delete_job_group(name: str) -> None:
method delete_job_groups_date (line 301) | def delete_job_groups_date(del_before_date: datetime) -> None:
method _list_jobs_status_type (line 320) | def _list_jobs_status_type(self, statuses: list[RunningStatus]) -> lis...
method list_successful_jobs (line 329) | def list_successful_jobs(self) -> list[RemoteJob]:
method list_active_jobs (line 335) | def list_active_jobs(self) -> list[RemoteJob]:
method list_unsuccessful_jobs (line 342) | def list_unsuccessful_jobs(self) -> list[RemoteJob]:
method list_unsent_jobs (line 348) | def list_unsent_jobs(self) -> list[RemoteJob]:
method _launch_wait_jobs (line 354) | def _launch_wait_jobs(self, concurrent_job_count: int | None, delay: f...
method run_sequential (line 422) | def run_sequential(self, delay: float) -> None:
method rerun_failed_sequential (line 434) | def rerun_failed_sequential(self, delay: float, replace_failed_jobs=Tr...
method run_parallel (line 449) | def run_parallel(self) -> None:
method rerun_failed_parallel (line 458) | def rerun_failed_parallel(self, replace_failed_jobs=True) -> None:
method launch_async_jobs (line 471) | def launch_async_jobs(self, concurrent_job_count = None):
method relaunch_async_failed_jobs (line 497) | def relaunch_async_failed_jobs(self, replace_failed_jobs=True, concurr...
method _get_jobs_availability (line 534) | def _get_jobs_availability(jobs, concurrent_job_count = None):
method cancel_all (line 559) | def cancel_all(self):
method get_results (line 571) | def get_results(self) -> list[dict]:
FILE: perceval/runtime/job_status.py
class RunningStatus (line 37) | class RunningStatus(Enum):
method from_server_response (line 48) | def from_server_response(res: str) -> RunningStatus:
method to_server_response (line 66) | def to_server_response(status: RunningStatus) -> str:
class JobStatus (line 93) | class JobStatus:
method __init__ (line 97) | def __init__(self):
method __call__ (line 109) | def __call__(self) -> str:
method status (line 118) | def status(self) -> RunningStatus:
method status (line 125) | def status(self, status: RunningStatus):
method start_run (line 128) | def start_run(self):
method stop_run (line 136) | def stop_run(self, cause: RunningStatus = RunningStatus.SUCCESS, mesg:...
method update_progress (line 151) | def update_progress(self, progress: float, phase: str | None = None):
method update_times (line 167) | def update_times(self, creation_datetime: float, start_time: float, du...
method creation_timestamp (line 182) | def creation_timestamp(self) -> float:
method start_timestamp (line 189) | def start_timestamp(self) -> float:
method duration (line 196) | def duration(self) -> float:
method waiting (line 203) | def waiting(self) -> bool:
method running (line 210) | def running(self) -> bool:
method completed (line 217) | def completed(self) -> bool:
method canceled (line 225) | def canceled(self) -> bool:
method success (line 232) | def success(self) -> bool:
method failed (line 239) | def failed(self) -> bool:
method maybe_completed (line 246) | def maybe_completed(self) -> bool:
method unknown (line 254) | def unknown(self) -> bool:
method stop_message (line 261) | def stop_message(self) -> str | None:
method progress (line 268) | def progress(self) -> float:
method running_time (line 275) | def running_time(self) -> float:
method __str__ (line 282) | def __str__(self) -> str:
FILE: perceval/runtime/local_job.py
class LocalJob (line 38) | class LocalJob(Job):
method __init__ (line 48) | def __init__(self,
method delta_parameters (line 63) | def delta_parameters(self) -> dict:
method set_progress_callback (line 66) | def set_progress_callback(self, callback: callable): # Signature must...
method status (line 77) | def status(self) -> JobStatus:
method _progress_cb (line 82) | def _progress_cb(self, progress: float, phase: str | None = None):
method execute_sync (line 90) | def execute_sync(self, *args, **kwargs) -> dict:
method _call_fn_safe (line 109) | def _call_fn_safe(self, *args, **kwargs):
method execute_async (line 125) | def execute_async(self, *args, **kwargs) -> LocalJob:
method cancel (line 137) | def cancel(self):
method _get_results (line 140) | def _get_results(self):
FILE: perceval/runtime/payload_generator.py
class PayloadGenerator (line 40) | class PayloadGenerator:
method generate_payload (line 43) | def generate_payload(command: str,
FILE: perceval/runtime/remote_config.py
class RemoteConfig (line 47) | class RemoteConfig:
method __init__ (line 57) | def __init__(self, persistent_data: PersistentData = PersistentData()):
method _get_deprecated_token (line 60) | def _get_deprecated_token(self):
method _get_remote_config (line 74) | def _get_remote_config(self, key) -> str | dict[str, str] | None:
method _get_token_from_env_var (line 81) | def _get_token_from_env_var() -> str | None:
method set_proxies (line 85) | def set_proxies(proxies: dict[str, str]) -> None:
method get_proxies (line 100) | def get_proxies(self) -> dict[str, str]:
method set_url (line 107) | def set_url(url: str) -> None:
method get_url (line 115) | def get_url(self) -> str:
method set_token (line 129) | def set_token(token: str) -> None:
method get_token (line 137) | def get_token(self) -> str:
method set_token_env_var (line 152) | def set_token_env_var(env_var: str) -> None:
method get_token_env_var (line 164) | def get_token_env_var() -> str:
method set_cloud_maximal_job_count (line 170) | def set_cloud_maximal_job_count(count: int) -> None:
method get_cloud_maximal_job_count (line 175) | def get_cloud_maximal_job_count() -> int:
method clear_cache (line 179) | def clear_cache():
method save (line 185) | def save(self) -> None:
FILE: perceval/runtime/remote_job.py
function _retrieve_from_response (line 43) | def _retrieve_from_response(response: dict, field: str, default_value: a...
class RemoteJob (line 55) | class RemoteJob(Job):
method __init__ (line 87) | def __init__(self, request_data: dict, rpc_handler: RPCHandler, job_na...
method delta_parameters (line 104) | def delta_parameters(self) -> SerializedDict:
method was_sent (line 108) | def was_sent(self) -> bool:
method id (line 115) | def id(self) -> str | None:
method from_id (line 124) | def from_id(job_id: str, rpc_handler: RPCHandler) -> RemoteJob:
method _from_dict (line 137) | def _from_dict(my_dict: dict, rpc_handler):
method _to_dict (line 154) | def _to_dict(self):
method set_job_group_name (line 173) | def set_job_group_name(self, group_name: str):
method _handle_status_error (line 176) | def _handle_status_error(self, error):
method status (line 202) | def status(self) -> JobStatus:
method _extract_job_times (line 228) | def _extract_job_times(self, response: dict) -> tuple[float, float, int]:
method execute_sync (line 240) | def execute_sync(self, *args, **kwargs) -> dict:
method _create_payload_data (line 258) | def _create_payload_data(self, *args, **kwargs) -> dict:
method execute_async (line 274) | def execute_async(self, *args, **kwargs) -> RemoteJob:
method _check_max_shots_samples_validity (line 287) | def _check_max_shots_samples_validity(self):
method cancel (line 295) | def cancel(self):
method rerun (line 306) | def rerun(self) -> RemoteJob:
method _get_results (line 325) | def _get_results(self) -> dict | None:
method __str__ (line 354) | def __str__(self):
FILE: perceval/runtime/remote_processor.py
class RemoteProcessor (line 48) | class RemoteProcessor(AProcessor):
method from_local_processor (line 50) | def from_local_processor(
method __init__ (line 70) | def __init__(self,
method _circuit_change_observer (line 124) | def _circuit_change_observer(self, new_component: Experiment | ACompon...
method _noise_changed_observer (line 137) | def _noise_changed_observer(self):
method is_remote (line 144) | def is_remote(self) -> bool:
method fetch_data (line 147) | def fetch_data(self):
method specs (line 161) | def specs(self):
method performance (line 165) | def performance(self):
method constraints (line 169) | def constraints(self) -> dict:
method status (line 175) | def status(self):
method check_circuit_size (line 178) | def check_circuit_size(self, m: int):
method check_circuit (line 186) | def check_circuit(self, circuit: ACircuit):
method set_circuit (line 189) | def set_circuit(self, circuit: ACircuit):
method get_rpc_handler (line 194) | def get_rpc_handler(self):
method type (line 198) | def type(self) -> ProcessorType:
method check_input (line 201) | def check_input(self, input_state: FockState) -> None:
method available_commands (line 219) | def available_commands(self) -> list[str]:
method prepare_job_payload (line 222) | def prepare_job_payload(self, command: str, **kwargs) -> dict[str, any]:
method resume_job (line 233) | def resume_job(self, job_id: str) -> RemoteJob:
method _compute_sample_of_interest_probability (line 236) | def _compute_sample_of_interest_probability(self, param_values: dict =...
method estimate_required_shots (line 272) | def estimate_required_shots(self, nsamples: int, param_values: dict = ...
method estimate_expected_samples (line 287) | def estimate_expected_samples(self, nshots: int, param_values: dict = ...
method log_resources (line 300) | def log_resources(self, command: str, extra_parameters: dict):
method compute_physical_logical_perf (line 321) | def compute_physical_logical_perf(self, value: bool):
FILE: perceval/runtime/rpc_handler.py
class RPCHandler (line 51) | class RPCHandler:
method __init__ (line 62) | def __init__(self, name, url, token, proxies = None):
method build_endpoint (line 70) | def build_endpoint(self, endpoint: str, *args: str):
method get_request (line 81) | def get_request(self, endpoint: str) -> None | dict:
method post_request (line 98) | def post_request(self, endpoint: str, payload: dict | None, with_json_...
method fetch_platform_details (line 121) | def fetch_platform_details(self):
method create_job (line 140) | def create_job(self, payload) -> str:
method cancel_job (line 152) | def cancel_job(self, job_id: str) -> None:
method rerun_job (line 160) | def rerun_job(self, job_id: str) -> str:
method get_job_status (line 171) | def get_job_status(self, job_id: str) -> dict:
method get_job_results (line 180) | def get_job_results(self, job_id: str) -> dict:
method get_job_availability (line 189) | def get_job_availability(self) -> dict:
FILE: perceval/runtime/session.py
class ISession (line 34) | class ISession(ABC):
method build_remote_processor (line 40) | def build_remote_processor(self) -> RemoteProcessor:
method start (line 45) | def start(self):
method stop (line 48) | def stop(self):
method __enter__ (line 51) | def __enter__(self):
method __exit__ (line 55) | def __exit__(self, exc_type, exc_val, exc_tb) -> bool:
FILE: perceval/serialization/_circuit_serialization.py
class ComponentSerializer (line 42) | class ComponentSerializer:
method __init__ (line 43) | def __init__(self):
method serialize (line 46) | def serialize(self, r: int, c: AComponent):
method _convert_bs_convention (line 53) | def _convert_bs_convention(self, convention):
method _serialize (line 61) | def _serialize(self, bs: comp.BS):
method _serialize (line 72) | def _serialize(self, ps: comp.PS):
method _serialize (line 80) | def _serialize(self, p: comp.PERM):
method _serialize (line 86) | def _serialize(self, unitary: comp.Unitary):
method _serialize (line 96) | def _serialize(self, _):
method _serialize (line 101) | def _serialize(self, wp: comp.QWP):
method _serialize (line 107) | def _serialize(self, wp: comp.HWP):
method _serialize (line 113) | def _serialize(self, wp: comp.WP):
method _serialize (line 120) | def _serialize(self, td: nu.TD):
method _serialize (line 126) | def _serialize(self, lc: nu.LC):
method _serialize (line 132) | def _serialize(self, pr: comp.PR):
method _serialize (line 138) | def _serialize(self, barrier: comp.Barrier):
method _serialize (line 144) | def _serialize(self, ffconfigurator: FFConfigurator):
method _serialize (line 166) | def _serialize(self, ffcp: FFCircuitProvider):
method _serialize (line 189) | def _serialize(self, circuit: Circuit):
method _serialize (line 194) | def _serialize(self, circuit: CompiledCircuit):
function serialize_circuit (line 199) | def serialize_circuit(circuit: ACircuit) -> pb.Circuit:
function serialize_compiled_circuit (line 213) | def serialize_compiled_circuit(circuit: CompiledCircuit) -> pb.CompiledC...
function serialize_component (line 223) | def serialize_component(component: AComponent) -> pb.Component:
function serialize_herald (line 227) | def serialize_herald(herald: Herald) -> pb.Herald:
function serialize_port (line 236) | def serialize_port(port: Port) -> pb.Port:
FILE: perceval/serialization/_component_deserialization.py
function deserialize_ps (line 41) | def deserialize_ps(serial_ps: pb.PhaseShifter, known_params: dict = None...
function _convert_bs_convention (line 48) | def _convert_bs_convention(ser_convention):
function deserialize_bs (line 56) | def deserialize_bs(serial_bs: pb.BeamSplitter, known_params: dict = None...
function deserialize_perm (line 66) | def deserialize_perm(serial_perm, _) -> comp.PERM:
function deserialize_unitary (line 70) | def deserialize_unitary(serial_unitary, _) -> comp.Unitary:
function deserialize_wp (line 75) | def deserialize_wp(serial_wp, known_params: dict = None) -> comp.WP:
function deserialize_qwp (line 80) | def deserialize_qwp(serial_qwp, known_params: dict = None) -> comp.QWP:
function deserialize_hwp (line 84) | def deserialize_hwp(serial_hwp, known_params: dict = None) -> comp.HWP:
function deserialize_dt (line 88) | def deserialize_dt(serial_dt, known_params: dict = None) -> nu.TD:
function deserialize_lc (line 92) | def deserialize_lc(serial_lc, known_params: dict = None) -> nu.LC:
function deserialize_pr (line 96) | def deserialize_pr(serial_pr, known_params: dict = None) -> comp.PR:
function deserialize_pbs (line 100) | def deserialize_pbs(_, __) -> comp.PBS:
function deserialize_barrier (line 104) | def deserialize_barrier(m: int, serial_barrier, _) -> comp.Barrier:
function deserialize_ff_configurator (line 108) | def deserialize_ff_configurator(m: int, serial_ffc, known_params: dict =...
function deserialize_ff_circuit_provider (line 122) | def deserialize_ff_circuit_provider(m: int, serial_ffcp, known_params: d...
function deserialize_cc (line 140) | def deserialize_cc(serial_cc, known_params: dict = None) -> CompiledCirc...
FILE: perceval/serialization/_detector_serialization.py
function serialize_bs_layer (line 33) | def serialize_bs_layer(detector: BSLayeredPPNR):
function deserialize_bs_layer (line 41) | def deserialize_bs_layer(pb_d: pb.BSLayeredPPNR) -> BSLayeredPPNR:
function serialize_detector (line 47) | def serialize_detector(detector: Detector):
function deserialize_detector (line 59) | def deserialize_detector(pb_d: pb.Detector) -> Detector:
FILE: perceval/serialization/_experiment_serialization.py
class ExperimentSerializer (line 40) | class ExperimentSerializer:
method __init__ (line 42) | def __init__(self):
method serialize (line 45) | def serialize(self, experiment: Experiment):
method _serialize_port (line 74) | def _serialize_port(port):
method _serialize_port (line 81) | def _serialize_port(port):
method _serialize_ports (line 86) | def _serialize_ports(self, in_ports: dict[APort, list[int]], out_ports...
method _serialize_detector (line 97) | def _serialize_detector(detector):
method _serialize_detector (line 104) | def _serialize_detector(detector):
method _serialize_detectors (line 109) | def _serialize_detectors(self, detectors: list[IDetector]):
method _serialize_components (line 115) | def _serialize_components(self, components: list[tuple[tuple, ACompone...
function serialize_experiment (line 122) | def serialize_experiment(experiment: Experiment):
FILE: perceval/serialization/_matrix_serialization.py
function serialize_matrix (line 37) | def serialize_matrix(m: Matrix) -> pb.Matrix:
function _deserialize_numeric (line 63) | def _deserialize_numeric(pb_mat):
function _deserialize_symbolic (line 76) | def _deserialize_symbolic(pb_mat):
function deserialize_pb_matrix (line 89) | def deserialize_pb_matrix(pb_mat: pb.Matrix) -> Matrix:
FILE: perceval/serialization/_parameter_serialization.py
function serialize_parameter (line 34) | def serialize_parameter(param: Parameter | float):
function deserialize_parameter (line 66) | def deserialize_parameter(serial_param: pb.Parameter, known_params = None):
FILE: perceval/serialization/_port_deserialization.py
function deserialize_herald (line 37) | def deserialize_herald(serial_herald) -> port.Herald:
function deserialize_port (line 52) | def deserialize_port(serial_port) -> port.Port:
FILE: perceval/serialization/_serialized_containers.py
class SerializedDict (line 36) | class SerializedDict(dict):
method __init__ (line 47) | def __init__(self, *args, **kwargs):
method __setitem__ (line 53) | def __setitem__(self, key, value):
method setdefault (line 56) | def setdefault(self, key, default = None, /):
method __delitem__ (line 61) | def __delitem__(self, key):
method __getitem__ (line 64) | def __getitem__(self, item):
method get (line 67) | def get(self, key, default=None):
method pop (line 70) | def pop(self, key, default=None):
method fromkeys (line 74) | def fromkeys(*args, **kwargs):
method __contains__ (line 77) | def __contains__(self, item):
method update (line 80) | def update(self, E=None, **F):
method __ior__ (line 92) | def __ior__(self, other):
method __or__ (line 96) | def __or__(self, other):
class SerializedList (line 102) | class SerializedList(list):
method __init__ (line 113) | def __init__(self, seq=()):
method __setitem__ (line 117) | def __setitem__(self, key, value):
method append (line 120) | def append(self, value):
method count (line 123) | def count(self, __value):
method extend (line 126) | def extend(self, __iterable):
method index (line 129) | def index(self, __value, __start = 0, __stop = sys.maxsize):
method insert (line 132) | def insert(self, __index, value):
method remove (line 135) | def remove(self, value):
method __add__ (line 138) | def __add__(self, other):
method __iadd__ (line 141) | def __iadd__(self, other):
method __contains__ (line 144) | def __contains__(self, item):
method __delitem__ (line 147) | def __delitem__(self, key):
function make_serialized (line 152) | def make_serialized(d: dict):
function make_serialized (line 158) | def make_serialized(l: list):
function make_serialized (line 164) | def make_serialized(o: object):
FILE: perceval/serialization/_state_serialization.py
function serialize_state (line 36) | def serialize_state(state: BasicState) -> str:
function deserialize_state (line 40) | def deserialize_state(serial_bs) -> BasicState:
function deserialize_state_list (line 44) | def deserialize_state_list(states):
function serialize_statevector (line 49) | def serialize_statevector(sv: StateVector) -> str:
function deserialize_statevector (line 59) | def deserialize_statevector(s) -> StateVector:
function serialize_bssamples (line 68) | def serialize_bssamples(bss: BSSamples) -> str:
function deserialize_bssamples (line 82) | def deserialize_bssamples(serialized_bss: str) -> BSSamples:
FILE: perceval/serialization/deserialize.py
function deserialize_float (line 63) | def deserialize_float(floatstring):
function deserialize_matrix (line 67) | def deserialize_matrix(pb_mat: str | pb.Matrix) -> Matrix:
function matrix_from_file (line 78) | def matrix_from_file(filepath: str) -> Matrix:
function deserialize_circuit (line 88) | def deserialize_circuit(pb_circ: str | bytes | pb.Circuit, known_params:...
function circuit_from_file (line 102) | def circuit_from_file(filepath: str) -> Circuit:
function deserialize_component (line 112) | def deserialize_component(pb_c: pb.Component, known_params: dict = None)...
function deserialize_experiment (line 124) | def deserialize_experiment(pb_e: pb.Experiment, known_params: dict = Non...
function deserialize_compiled_circuit (line 137) | def deserialize_compiled_circuit(pb_cc: pb.CompiledCircuit, known_params...
function deserialize_svdistribution (line 149) | def deserialize_svdistribution(serial_svd) -> SVDistribution:
function deserialize_bsdistribution (line 160) | def deserialize_bsdistribution(serial_bsd) -> BSDistribution:
function deserialize_bscount (line 171) | def deserialize_bscount(serial_bsc) -> BSCount:
function deserialize_noise_model (line 182) | def deserialize_noise_model(serial_nm: str) -> NoiseModel:
function deserialize_postselect (line 186) | def deserialize_postselect(serial_ps: str) -> PostSelect:
function deserialize_bs_layered_detector (line 190) | def deserialize_bs_layered_detector(pb_detect: str | bytes | pb.BSLayere...
function deserialize_detector (line 201) | def deserialize_detector(pb_detect: str | bytes | pb.Detector) -> Detector:
function deserialize (line 234) | def deserialize(obj, strict=True):
function deserialize_file (line 272) | def deserialize_file(filepath: str, strict=True):
class CircuitBuilder (line 282) | class CircuitBuilder:
method __init__ (line 304) | def __init__(self, m: int, name: str, params: dict):
method add (line 310) | def add(self, serial_comp):
method retrieve (line 314) | def retrieve(self):
method deserialize (line 318) | def deserialize(serial_comp, params):
class ExperimentBuilder (line 336) | class ExperimentBuilder:
method __init__ (line 347) | def __init__(self, pb_e: pb.Experiment, params: dict):
method deserialize_ports (line 351) | def deserialize_ports(self, experiment, serialized_port_map, location:...
method resolve (line 363) | def resolve(self):
FILE: perceval/serialization/serialize.py
function b64encoding (line 47) | def b64encoding(obj: bytes) -> str:
function _handle_compress_parameter (line 52) | def _handle_compress_parameter(compress, type_str) -> bool:
function _handle_compress_parameter (line 57) | def _handle_compress_parameter(compress, type_str) -> bool:
function _handle_compression (line 61) | def _handle_compression(serialized_obj: str, do_compress: bool) -> str:
function serialize (line 70) | def serialize(component: AComponent, compress=None) -> str:
function serialize (line 81) | def serialize(circuit: ACircuit, compress=None) -> str:
function serialize (line 92) | def serialize(experiment: Experiment, compress=None) -> str:
function serialize (line 103) | def serialize(compiled_circuit: CompiledCircuit, compress=None) -> str:
function serialize (line 114) | def serialize(herald: Herald, compress=None) -> str:
function serialize (line 124) | def serialize(port: Port, compress=None) -> str:
function serialize (line 134) | def serialize(m: Matrix, compress=None) -> str:
function serialize (line 144) | def serialize(obj, compress=None) -> str:
function serialize (line 154) | def serialize(sv, compress=None) -> str:
function serialize (line 163) | def serialize(dist: SVDistribution, compress=None) -> str:
function serialize (line 176) | def serialize(dist: BSDistribution, compress=None) -> str:
function serialize (line 188) | def serialize(obj, compress=None) -> str:
function serialize (line 200) | def serialize(obj, compress=None) -> str:
function serialize (line 209) | def serialize(obj, compress=None):
function serialize (line 218) | def serialize(ps: PostSelect, compress=None):
function serialize (line 227) | def serialize(obj: BSLayeredPPNR, compress=None):
function serialize (line 237) | def serialize(obj: Detector, compress=None):
function serialize (line 247) | def serialize(obj, compress=None) -> dict:
function serialize (line 255) | def serialize(obj, compress=None) -> list:
function serialize (line 263) | def serialize(obj, compress=None) -> object:
function serialize_to_file (line 267) | def serialize_to_file(obj, filepath: str, compress=None) -> None:
FILE: perceval/serialization/serialize_binary.py
function serialize_binary (line 45) | def serialize_binary(circuit: ACircuit):
function serialize_binary (line 50) | def serialize_binary(matrix: Matrix):
FILE: perceval/simulators/_simulate_detectors.py
function heralds_compatible_threshold (line 36) | def heralds_compatible_threshold(s: FockState, heralds: dict[int, int]) ...
function compute_distributions (line 50) | def compute_distributions(s: FockState, detectors: list[IDetector], hera...
function simulate_detectors (line 85) | def simulate_detectors(dist: BSDistribution, detectors: list[IDetector],...
function simulate_detectors_sample (line 152) | def simulate_detectors_sample(sample: FockState, detectors: list[IDetect...
FILE: perceval/simulators/_simulator_utils.py
function _to_bsd (line 39) | def _to_bsd(sv: StateVector) -> BSDistribution:
function _inject_annotation (line 49) | def _inject_annotation(sv: StateVector, annotation: Annotation) -> State...
function _inject_annotation (line 60) | def _inject_annotation(sv: StateVector, annotation: int) -> StateVector:
function _merge_sv (line 68) | def _merge_sv(sv1: StateVector, sv2: StateVector, prob_threshold: float ...
function _annot_state_mapping (line 82) | def _annot_state_mapping(bs_with_annots: FockState):
function _annot_state_mapping (line 87) | def _annot_state_mapping(bs_with_annots: NoisyFockState):
function _annot_state_mapping (line 92) | def _annot_state_mapping(bs_with_annots: AnnotatedFockState):
function _separate_state (line 98) | def _separate_state(bs_with_annots: FockState):
function _separate_state (line 103) | def _separate_state(bs_with_annots: NoisyFockState):
function _separate_state (line 108) | def _separate_state(bs_with_annots: AnnotatedFockState):
function _retrieve_mode_count (line 113) | def _retrieve_mode_count(component_list: list) -> int:
function _unitary_components_to_circuit (line 117) | def _unitary_components_to_circuit(component_list: list, m: int = 0):
function _split_by_photon_and_tag_count (line 126) | def _split_by_photon_and_tag_count(sv: StateVector) -> SVDistribution:
function _list_merge (line 148) | def _list_merge(distributions: list[Iterable[tuple[FockState, float]]], ...
FILE: perceval/simulators/delay_simulator.py
class _CType (line 39) | class _CType(Enum):
function _count_total_delay (line 45) | def _count_total_delay(component_list: list) -> int:
function _compute_depth (line 49) | def _compute_depth(component_list: list, mode_count: int) -> int:
class DelaySimulator (line 78) | class DelaySimulator(ASimulatorDecorator):
method __init__ (line 82) | def __init__(self, simulator):
method _prepare_input (line 88) | def _prepare_input(self, input_state):
method _prepare_circuit (line 95) | def _prepare_circuit(self, circuit, m=None):
method _prepare_detectors_impl (line 105) | def _prepare_detectors_impl(self, detectors: list[IDetector]):
method _mode_range (line 110) | def _mode_range(self) -> tuple[int, int]:
method _postprocess_bsd_impl (line 113) | def _postprocess_bsd_impl(self, results):
method _postprocess_sv_impl (line 122) | def _postprocess_sv_impl(self, results: StateVector) -> StateVector:
method _transmit_heralds_postselect (line 131) | def _transmit_heralds_postselect(self):
method _expand_td (line 141) | def _expand_td(self, component_list: list):
FILE: perceval/simulators/feed_forward_simulator.py
class FFSimulator (line 42) | class FFSimulator(ISimulator):
method __init__ (line 44) | def __init__(self, backend: AStrongSimulationBackend):
method compute_physical_logical_perf (line 53) | def compute_physical_logical_perf(self, value: bool):
method set_circuit (line 58) | def set_circuit(self, circuit: Processor | Experiment | list[tuple[tup...
method set_noise (line 68) | def set_noise(self, nm: NoiseModel):
method set_source (line 72) | def set_source(self, source: Source):
method _probs_svd (line 75) | def _probs_svd(self,
method _find_next_simulation_layer (line 172) | def _find_next_simulation_layer(self) -> tuple[list[tuple[int, AFFConf...
method _get_sim_params (line 214) | def _get_sim_params(self,
method _simulate (line 286) | def _simulate(self, input_state: SVDistribution | tuple[Source, BasicS...
method _post_process_state (line 297) | def _post_process_state(self, bs: BasicState) -> bool:
method _remove_heralds (line 307) | def _remove_heralds(self, state: BasicState) -> BasicState:
method probs (line 312) | def probs(self, input_state: BasicState) -> BSDistribution:
method probs_svd (line 330) | def probs_svd(self,
method evolve (line 362) | def evolve(self, input_state: FockState | StateVector) -> StateVector:
method set_precision (line 372) | def set_precision(self, precision: float):
FILE: perceval/simulators/loss_simulator.py
class LossSimulator (line 36) | class LossSimulator(ASimulatorDecorator):
method _prepare_input (line 40) | def _prepare_input(self, input_state):
method _prepare_circuit (line 45) | def _prepare_circuit(self, circuit, m = None):
method _prepare_detectors_impl (line 54) | def _prepare_detectors_impl(self, detectors: list[IDetector]):
method _postprocess_bsd_impl (line 57) | def _postprocess_bsd_impl(self, results: BSDistribution) -> BSDistribu...
method _postprocess_sv_impl (line 64) | def _postprocess_sv_impl(self, sv: StateVector) -> StateVector:
method _transmit_heralds_postselect (line 71) | def _transmit_heralds_postselect(self):
method _simulate_losses_with_beam_splitters (line 74) | def _simulate_losses_with_beam_splitters(self, components: list) -> AC...
FILE: perceval/simulators/noisy_sampling_simulator.py
class SamplesProvider (line 44) | class SamplesProvider:
method __init__ (line 46) | def __init__(self, sampling_backend: ASamplingBackend):
method prepare (line 55) | def prepare(self, progress_callback: callable = None):
method estimate_weights_from_distribution (line 78) | def estimate_weights_from_distribution(self, noisy_input: SVDistributi...
method estimate_weights_from_source (line 97) | def estimate_weights_from_source(self, sample_generator: Callable[[int...
method _compute_samples (line 113) | def _compute_samples(self, fock_state: FockState):
method sample_from (line 124) | def sample_from(self, input_state: FockState) -> BasicState:
class NoisySamplingSimulator (line 132) | class NoisySamplingSimulator:
method __init__ (line 141) | def __init__(self, sampling_backend: ASamplingBackend):
method min_detected_photons_filter (line 152) | def min_detected_photons_filter(self):
method set_detectors (line 155) | def set_detectors(self, detector_list: list[IDetector]):
method keep_heralds (line 161) | def keep_heralds(self, value: bool):
method compute_physical_logical_perf (line 169) | def compute_physical_logical_perf(self, value: bool):
method set_selection (line 177) | def set_selection(self,
method _state_selected (line 196) | def _state_selected(self, state: BasicState) -> bool:
method set_circuit (line 207) | def set_circuit(self, circuit: ACircuit):
method set_min_detected_photons_filter (line 215) | def set_min_detected_photons_filter(self, value: int):
method _perfect_sampling_no_selection (line 223) | def _perfect_sampling_no_selection(
method _noisy_sampling (line 245) | def _noisy_sampling(
method _check_input_svd (line 320) | def _check_input_svd(self, svd: SVDistribution) -> tuple[float, float]:
method _preprocess_input_state (line 343) | def _preprocess_input_state(self, svd: SVDistribution, max_p: float, n...
method _compute_samples_with_perf (line 363) | def _compute_samples_with_perf(self, prepare_samples: int, physical_pe...
method _prepare_provider (line 373) | def _prepare_provider(self, provider: SamplesProvider,
method compute_samples (line 416) | def compute_samples(max_samples: int, max_shots: int) -> int:
method samples (line 423) | def samples(self,
method sample_count (line 481) | def sample_count(self,
method log_resources (line 504) | def log_resources(self, method: str, extra_parameters: dict):
method format_results (line 526) | def format_results(self, results, physical_perf, logical_perf):
FILE: perceval/simulators/polarization_simulator.py
class PolarizationSimulator (line 35) | class PolarizationSimulator(ASimulatorDecorator):
method __init__ (line 36) | def __init__(self, simulator):
method _prepare_input (line 40) | def _prepare_input(self, input_state):
method set_circuit (line 57) | def set_circuit(self, circuit, m=None):
method _prepare_circuit (line 60) | def _prepare_circuit(self, circuit, m=None):
method _prepare_detectors_impl (line 63) | def _prepare_detectors_impl(self, detectors: list[IDetector]):
method _split_odd_even (line 68) | def _split_odd_even(self, fs):
method _postprocess_sv_impl (line 73) | def _postprocess_sv_impl(self, results: StateVector) -> StateVector:
method _postprocess_bsd_impl (line 84) | def _postprocess_bsd_impl(self, results: BSDistribution) -> BSDistribu...
method set_min_detected_photons_filter (line 92) | def set_min_detected_photons_filter(self, value: int):
FILE: perceval/simulators/simulator.py
class Simulator (line 51) | class Simulator(ISimulator):
method __init__ (line 61) | def __init__(self, backend: AStrongSimulationBackend):
method precision (line 73) | def precision(self):
method precision (line 77) | def precision(self, value: float):
method set_precision (line 81) | def set_precision(self, precision: float):
method set_heralds (line 89) | def set_heralds(self, heralds):
method keep_heralds (line 98) | def keep_heralds(self, value: bool):
method logical_perf (line 107) | def logical_perf(self):
method set_postselection (line 110) | def set_postselection(self, postselect: PostSelect):
method clear_postselection (line 117) | def clear_postselection(self):
method clear_heralds (line 121) | def clear_heralds(self):
method set_circuit (line 126) | def set_circuit(self, circuit: ACircuit, m = None):
method prob_amplitude (line 137) | def prob_amplitude(self, input_state: FockState, output_state: FockSta...
method prob_amplitude (line 151) | def prob_amplitude(self, input_state: NoisyFockState, output_state: No...
method prob_amplitude (line 180) | def prob_amplitude(self, input_state: NoisyFockState, output_state: Fo...
method prob_amplitude (line 191) | def prob_amplitude(self, input_state: FockState, output_state: NoisyFo...
method prob_amplitude (line 202) | def prob_amplitude(self, input_state: StateVector, output_state: FockS...
method prob_amplitude (line 209) | def prob_amplitude(self, input_state: StateVector, output_state: Noisy...
method probability (line 216) | def probability(self, input_state: FockState, output_state: FockState)...
method probability (line 238) | def probability(self, input_state: NoisyFockState, output_state: FockS...
method probability (line 260) | def probability(self, input_state: StateVector, output_state: FockStat...
method probability (line 271) | def probability(self, input_state: StateVector, output_state: NoisyFoc...
method _invalidate_cache (line 282) | def _invalidate_cache(self):
method _evolve_cache (line 287) | def _evolve_cache(self, input_list: set[FockState]):
method _evolve_cache_with_n (line 294) | def _evolve_cache_with_n(self, input_list: set[tuple[FockState, int]],...
method _merge_probability_dist (line 309) | def _merge_probability_dist(self, input_list: list[FockState]) -> BSDi...
method probs (line 315) | def probs(self, input_state: FockState) -> BSDistribution:
method probs (line 328) | def probs(self, input_state: NoisyFockState) -> BSDistribution:
method probs (line 341) | def probs(self, input_state: StateVector) -> BSDistribution:
method _probs_svd_generic (line 346) | def _probs_svd_generic(self, input_dist, p_threshold, non_pnr_detector...
method _probs_svd_fast (line 412) | def _probs_svd_fast(self, input_dist, p_threshold, non_pnr_detector_mo...
method _get_prob_threshold (line 516) | def _get_prob_threshold(self, max_p: float) -> float:
method _preprocess_iterator (line 519) | def _preprocess_iterator(self, svd: tuple[Source, FockState]) -> tuple...
method _preprocess_svd (line 525) | def _preprocess_svd(self, svd: SVDistribution) -> tuple[SVDistribution...
method probs_svd (line 572) | def probs_svd(self,
method _setup_heralds (line 650) | def _setup_heralds(self, n=None, non_pnr_detector_modes=None):
method init_use_mask (line 664) | def init_use_mask(self, is_pnr) -> None:
method use_mask (line 668) | def use_mask(self, n=None, non_pnr_detector_modes=None):
method _best_n (line 674) | def _best_n(self, n_ext: int, n_own: int) -> int:
method probs_density_matrix (line 683) | def probs_density_matrix(self, dm: DensityMatrix) -> dict:
method _evolve_no_compute (line 718) | def _evolve_no_compute(self, decomposed_input, n_photons):
method _prepare_decomposed_input (line 743) | def _prepare_decomposed_input(self, input_state: SVDistribution):
method evolve (line 753) | def evolve(self, input_state: BasicState | StateVector) -> StateVector:
method evolve_svd (line 767) | def evolve_svd(self,
method evolve_density_matrix (line 810) | def evolve_density_matrix(self, dm: DensityMatrix) -> DensityMatrix:
method _construct_evolve_operator (line 833) | def _construct_evolve_operator(self, input_list: list[BasicState], dm:...
method _get_density_matrix_input_list (line 860) | def _get_density_matrix_input_list(dm: DensityMatrix) -> list:
method log_resources (line 870) | def log_resources(self, method: str, extra_parameters: dict):
FILE: perceval/simulators/simulator_factory.py
class SimulatorFactory (line 40) | class SimulatorFactory:
method build (line 48) | def build(circuit: ACircuit | Processor | list,
FILE: perceval/simulators/simulator_interface.py
class ISimulator (line 36) | class ISimulator(ABC):
method __init__ (line 38) | def __init__(self):
method set_silent (line 46) | def set_silent(self, silent: bool):
method set_circuit (line 50) | def set_circuit(self, circuit, m = None):
method probs (line 54) | def probs(self, input_state) -> BSDistribution:
method probs_svd (line 58) | def probs_svd(self,
method evolve (line 65) | def evolve(self, input_state) -> StateVector:
method set_min_detected_photons_filter (line 68) | def set_min_detected_photons_filter(self, value: int):
method set_precision (line 76) | def set_precision(self, precision: float):
method set_heralds (line 79) | def set_heralds(self, heralds: dict[int, int]):
method set_selection (line 82) | def set_selection(self,
method min_detected_photons_filter (line 102) | def min_detected_photons_filter(self) -> int:
method keep_heralds (line 109) | def keep_heralds(self, value: bool):
method compute_physical_logical_perf (line 117) | def compute_physical_logical_perf(self, value: bool):
method format_results (line 125) | def format_results(self, results: dict(), physical_perf: float, logica...
class ASimulatorDecorator (line 141) | class ASimulatorDecorator(ISimulator, ABC):
method __init__ (line 145) | def __init__(self, simulator: ISimulator):
method _prepare_input (line 150) | def _prepare_input(self, input_state):
method _prepare_circuit (line 154) | def _prepare_circuit(self, circuit, m = None) -> ACircuit:
method _postprocess_bsd_impl (line 158) | def _postprocess_bsd_impl(self, bsd: BSDistribution) -> BSDistribution:
method _postprocess_sv_impl (line 162) | def _postprocess_sv_impl(self, sv: StateVector) -> StateVector:
method _prepare_detectors_impl (line 166) | def _prepare_detectors_impl(self, detectors: list[IDetector]) -> list[...
method _transmit_heralds_postselect (line 169) | def _transmit_heralds_postselect(self):
method _prepare_detectors (line 172) | def _prepare_detectors(self, detectors: list[IDetector] = None) -> lis...
method _postprocess_bsd (line 177) | def _postprocess_bsd(self, results: BSDistribution):
method _postprocess_sv (line 193) | def _postprocess_sv(self, sv: StateVector) -> StateVector:
method compute_physical_logical_perf (line 199) | def compute_physical_logical_perf(self, value: bool):
method set_circuit (line 203) | def set_circuit(self, circuit, m=None):
method probs (line 206) | def probs(self, input_state) -> BSDistribution:
method probs_svd (line 213) | def probs_svd(self, svd: SVDistribution, detectors=None, progress_call...
method evolve (line 226) | def evolve(self, input_state) -> StateVector:
method set_min_detected_photons_filter (line 230) | def set_min_detected_photons_filter(self, value: int):
method set_precision (line 234) | def set_precision(self, precision: float):
FILE: perceval/simulators/stepper.py
class Stepper (line 40) | class Stepper(ISimulator):
method __init__ (line 45) | def __init__(self, backend: AStrongSimulationBackend = None):
method _clear_cache (line 54) | def _clear_cache(self):
method set_circuit (line 58) | def set_circuit(self, circuit: ACircuit, m=None):
method apply (line 62) | def apply(self, sv: StateVector, r: list[int], c: ACircuit) -> StateVe...
method probs (line 100) | def probs(self, input_state: BasicState | StateVector) -> BSDistribution:
method probs_svd (line 108) | def probs_svd(self, svd: SVDistribution, detectors=None, progress_call...
method evolve (line 131) | def evolve(self, input_state: BasicState | StateVector) -> StateVector:
method compile (line 142) | def compile(self, input_states: BasicState | StateVector) -> bool:
FILE: perceval/utils/_enums.py
class Encoding (line 33) | class Encoding(Enum):
method logical_length (line 46) | def logical_length(self) -> int:
method fock_length (line 54) | def fock_length(self) -> int:
class InterferometerShape (line 76) | class InterferometerShape(Enum):
class FileFormat (line 86) | class FileFormat(Enum):
class ModeType (line 91) | class ModeType(Enum):
FILE: perceval/utils/_random.py
function random_seed (line 36) | def random_seed(seed: int = None):
FILE: perceval/utils/_validated_params.py
class AValidatedParam (line 34) | class AValidatedParam(ABC):
method __init__ (line 36) | def __init__(self, default_value = None):
method __set_name__ (line 41) | def __set_name__(self, owner, name):
method __get__ (line 45) | def __get__(self, obj, objtype=None):
method __set__ (line 51) | def __set__(self, obj, value):
method _validate (line 57) | def _validate(self, value):
method is_default (line 60) | def is_default(self):
class ValidatedBool (line 64) | class ValidatedBool(AValidatedParam):
method __init__ (line 65) | def __init__(self, default_value=None):
method _validate (line 68) | def _validate(self, value):
class ValidatedFloat (line 74) | class ValidatedFloat(AValidatedParam):
method __init__ (line 75) | def __init__(self, min_value=None, max_value=None, default_value=None):
method _validate (line 80) | def _validate(self, value):
FILE: perceval/utils/algorithms/circuit_optimizer.py
class CircuitOptimizer (line 38) | class CircuitOptimizer:
method __init__ (line 55) | def __init__(self, threshold: float = 1e-6, ntrials: int = 4, max_eval...
method threshold (line 62) | def threshold(self):
method threshold (line 66) | def threshold(self, value):
method trials (line 72) | def trials(self):
method trials (line 76) | def trials(self, value):
method max_eval_per_trial (line 80) | def max_eval_per_trial(self):
method max_eval_per_trial (line 84) | def max_eval_per_trial(self, value):
method optimize (line 87) | def optimize(self,
method optimize_rectangle (line 133) | def optimize_rectangle(self,
FILE: perceval/utils/algorithms/decomposition.py
function add_phases (line 41) | def add_phases(phase_shifter_fn, D):
function decompose_triangle (line 63) | def decompose_triangle(u,
function decompose_rectangle (line 144) | def decompose_rectangle(u,
FILE: perceval/utils/algorithms/match.py
class Match (line 30) | class Match:
method __init__ (line 31) | def __init__(self):
method matched (line 36) | def matched(self):
method v_map (line 40) | def v_map(self):
method pos_map (line 44) | def pos_map(self):
method pos_map (line 48) | def pos_map(self, v):
method __str__ (line 51) | def __str__(self):
FILE: perceval/utils/algorithms/norm.py
function _count_non_skipped_cols (line 34) | def _count_non_skipped_cols(nb_colums: int, skip_colums: list[int]) -> int:
function fidelity (line 37) | def fidelity(u: Matrix, v: Matrix, skip_colums: list[int] = []) -> float:
function modulus_fidelity (line 54) | def modulus_fidelity(u: Matrix, v: Matrix, skip_colums: list[int] = []) ...
function frobenius (line 72) | def frobenius(u: Matrix, v: Matrix, skip_colums: list[int] = []) -> float:
function frobenius_inner_product (line 83) | def frobenius_inner_product(A: np.ndarray, B: np.ndarray, skip_colums: l...
FILE: perceval/utils/algorithms/optimize.py
function _min_fnc (line 36) | def _min_fnc(c: ACircuit, params: list[P], x: list[int], v: Matrix | None,
function _stop_criterion (line 44) | def _stop_criterion(f, f0, precision, accept):
function optimize (line 51) | def optimize(c: ACircuit,
FILE: perceval/utils/algorithms/simplification.py
function simplify (line 35) | def simplify(circuit: list | ACircuit, m: int = None, display: bool = Fa...
function _simplify_comp (line 72) | def _simplify_comp(components, m: int=None, display: bool=False):
function extend_perm (line 90) | def extend_perm(r, perm_list, m):
function perm_compose (line 98) | def perm_compose(left_r, left_perm, right_r, right_perm):
function reduce_perm (line 111) | def reduce_perm(r, perm):
function invert_permutation (line 126) | def invert_permutation(permutation):
function _update_adjacent (line 136) | def _update_adjacent(adjacent_modes, r):
function _generate_compatible_perm (line 152) | def _generate_compatible_perm(perm_list, adjacent_modes):
function _search_empty_space (line 210) | def _search_empty_space(perm, n, init):
function _update_perm (line 225) | def _update_perm(perm, init, modes):
function _move_comp (line 260) | def _move_comp(in_components, perm):
function _evaluate_perm (line 273) | def _evaluate_perm(left_perm_list, right_perm_list, display):
function _simplify_perm (line 290) | def _simplify_perm(components, m: int = None, display: bool = False):
function _simplify_PS (line 374) | def _simplify_PS(components, m: int = None, display: bool = False):
FILE: perceval/utils/algorithms/solve.py
function solve (line 33) | def solve(f, x0, constraint, bounds, precision, allow_error=False):
FILE: perceval/utils/conversion.py
function _deduce_count (line 37) | def _deduce_count(**kwargs) -> int:
function samples_to_sample_count (line 52) | def samples_to_sample_count(sample_list: BSSamples) -> BSCount:
function samples_to_probs (line 62) | def samples_to_probs(sample_list: BSSamples) -> BSDistribution:
function probs_to_sample_count (line 72) | def probs_to_sample_count(probs: BSDistribution, **kwargs) -> BSCount:
function probs_to_samples (line 119) | def probs_to_samples(probs: BSDistribution, **kwargs) -> BSSamples:
function sample_count_to_probs (line 139) | def sample_count_to_probs(sample_count: BSCount) -> BSDistribution:
function sample_count_to_samples (line 158) | def sample_count_to_samples(sample_count: BSCount, **kwargs) -> BSSamples:
FILE: perceval/utils/density_matrix.py
class FockBasis (line 49) | class FockBasis(dict):
method __init__ (line 51) | def __init__(self, m, n_max):
method add_photon (line 58) | def add_photon(self):
method add_photons (line 65) | def add_photons(self, n):
method m (line 70) | def m(self):
method n_max (line 74) | def n_max(self):
function density_matrix_tensor_product (line 78) | def density_matrix_tensor_product(A, B):
class DensityMatrix (line 107) | class DensityMatrix:
method __init__ (line 116) | def __init__(self,
method from_svd (line 156) | def from_svd(svd: SVDistribution | StateVector | BasicState, index: Fo...
method set_index (line 192) | def set_index(self, index: dict):
method __getitem__ (line 208) | def __getitem__(self, key: tuple[BasicState, BasicState]):
method _deflation (line 217) | def _deflation(A: sparray, val: np.ndarray, vec: np.ndarray):
method _bra_str (line 244) | def _bra_str(bs: BasicState):
method _to_svd_small (line 247) | def _to_svd_small(self, threshold):
method _to_svd_large (line 258) | def _to_svd_large(self, threshold, batch_size):
method to_svd (line 280) | def to_svd(self, threshold: float | None = None, batch_size: int = 1):
method __radd__ (line 301) | def __radd__(self, other):
method __add__ (line 312) | def __add__(self, other):
method __mul__ (line 337) | def __mul__(self, other):
method __rmul__ (line 350) | def __rmul__(self, other):
method remove_low_amplitude (line 363) | def remove_low_amplitude(self, threshold: float | None = None):
method normalize (line 381) | def normalize(self):
method sample (line 391) | def sample(self, count: int = 1) -> BSSamples:
method measure (line 402) | def measure(self, modes: list[int] | int):
method _construct_projector_one_sample (line 425) | def _construct_projector_one_sample(self, modes, fock_state) -> tuple[...
method _construct_all_projectors (line 442) | def _construct_all_projectors(self, modes: list[int]) -> dict:
method _divide_fock_state (line 469) | def _divide_fock_state(fs, modes):
method _get_annihilated_fockstate (line 484) | def _get_annihilated_fockstate(fockstate, m, n_photon):
method _construct_loss_operators (line 496) | def _construct_loss_operators(self, mode: int, p: float):
method apply_loss (line 516) | def apply_loss(self, modes: int | list, prob: float):
method _apply_loss (line 531) | def _apply_loss(self, mode: int, prob: float):
method __str__ (line 538) | def __str__(self):
method __repr__ (line 556) | def __repr__(self):
method n_max (line 560) | def n_max(self):
method m (line 564) | def m(self):
method shape (line 568) | def shape(self):
method size (line 572) | def size(self):
FILE: perceval/utils/density_matrix_utils.py
function extract_upper_triangle (line 36) | def extract_upper_triangle(csr_matrix: csr_array) -> csr_array:
function statevector_to_array (line 70) | def statevector_to_array(sv: StateVector, index: dict):
function array_to_statevector (line 82) | def array_to_statevector(vector: np.ndarray | sparray, reverse_index: li...
function is_hermitian (line 98) | def is_hermitian(matrix: sparray | np.ndarray) -> bool:
FILE: perceval/utils/dist_metrics.py
function tvd_dist (line 34) | def tvd_dist(dist_lh: BSDistribution, dist_rh: BSDistribution) -> float:
function kl_divergence (line 55) | def kl_divergence(ideal_dist: BSDistribution, est_dist: BSDistribution) ...
FILE: perceval/utils/format.py
function simple_float (line 34) | def simple_float(alpha, precision=1e-6, nsimplify=True, fracmax=63, mult...
function simple_complex (line 88) | def simple_complex(c, precision=1e-6, nsimplify=True, fracmax=63):
function format_parameters (line 115) | def format_parameters(params: dict, precision: float = 1e-6, nsimplify: ...
FILE: perceval/utils/logging/__init__.py
function get_logger (line 42) | def get_logger():
function _my_excepthook (line 47) | def _my_excepthook(excType, excValue, this_traceback):
function deprecated (line 53) | def deprecated(*decorator_args, **decorator_kwargs):
function use_python_logger (line 68) | def use_python_logger(logger = None):
function use_perceval_logger (line 78) | def use_perceval_logger():
function apply_config (line 89) | def apply_config(config: LoggerConfig):
FILE: perceval/utils/logging/config.py
class LoggerConfig (line 42) | class LoggerConfig(dict):
method __init__ (line 46) | def __init__(self):
method _init_channel (line 52) | def _init_channel(self, channel: exqalibur_logging.channel, level: exq...
method reset (line 56) | def reset(self):
method _load_from_persistent_data (line 69) | def _load_from_persistent_data(self):
method set_level (line 85) | def set_level(self, level: exqalibur_logging.level, channel: exqalibur...
method use_python_logger (line 96) | def use_python_logger(self):
method use_perceval_logger (line 103) | def use_perceval_logger(self):
method python_logger_is_enabled (line 110) | def python_logger_is_enabled(self):
method enable_file (line 113) | def enable_file(self):
method disable_file (line 120) | def disable_file(self):
method save (line 127) | def save(self):
FILE: perceval/utils/logging/loggers.py
class ALogger (line 47) | class ALogger(ABC):
method apply_config (line 49) | def apply_config(self, config: LoggerConfig):
method enable_file (line 53) | def enable_file(self):
method disable_file (line 57) | def disable_file(self):
method set_level (line 61) | def set_level(self, level: int, channel: xq_log.channel = DEFAULT_CHAN...
method debug (line 65) | def debug(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method info (line 69) | def info(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method warn (line 73) | def warn(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method error (line 77) | def error(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL, e...
method critical (line 81) | def critical(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL...
method log_resources (line 84) | def log_resources(self, my_dict: dict):
class ExqaliburLogger (line 95) | class ExqaliburLogger(ALogger):
method initialize (line 98) | def initialize(self):
method _configure_logger (line 112) | def _configure_logger(self, logger_config: LoggerConfig):
method apply_config (line 128) | def apply_config(self, config: LoggerConfig):
method get_log_file_path (line 134) | def get_log_file_path(self):
method enable_file (line 137) | def enable_file(self):
method disable_file (line 141) | def disable_file(self):
method set_level (line 145) | def set_level(
method debug (line 152) | def debug(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method info (line 155) | def info(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method warn (line 158) | def warn(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method _format_exception (line 161) | def _format_exception(self, exc_info=None) -> str:
method error (line 166) | def error(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL, e...
method critical (line 173) | def critical(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL...
class PythonLogger (line 181) | class PythonLogger(ALogger):
method __init__ (line 184) | def __init__(self, logger: py_log.Logger = None):
method _get_levelno (line 207) | def _get_levelno(level_name: str):
method _configure_levels (line 210) | def _configure_levels(self, config: LoggerConfig):
method apply_config (line 215) | def apply_config(self, config: LoggerConfig):
method _message_has_to_be_logged (line 221) | def _message_has_to_be_logged(self, record) -> bool:
method enable_file (line 226) | def enable_file(self):
method disable_file (line 229) | def disable_file(self):
method set_level (line 232) | def set_level(self, level: xq_log.level, channel: xq_log.channel = DEF...
method debug (line 242) | def debug(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method info (line 245) | def info(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method warn (line 248) | def warn(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL):
method error (line 251) | def error(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL, e...
method critical (line 257) | def critical(self, msg: str, channel: xq_log.channel = DEFAULT_CHANNEL...
FILE: perceval/utils/logical_state.py
class LogicalState (line 31) | class LogicalState(list):
method __init__ (line 38) | def __init__(self, state: list[int] or str = None):
method __add__ (line 51) | def __add__(self, other):
method __str__ (line 56) | def __str__(self):
function generate_all_logical_states (line 62) | def generate_all_logical_states(n : int) -> list[LogicalState]:
FILE: perceval/utils/matrix.py
class Matrix (line 41) | class Matrix(ABC):
method __new__ (line 54) | def __new__(cls, source, use_symbolic=None):
method eye (line 94) | def eye(n: int, use_symbolic: bool = False) -> Matrix:
method zeros (line 106) | def zeros(shape: tuple[int, int], use_symbolic: bool = False) -> Matrix:
method is_square (line 117) | def is_square(self) -> bool:
method is_unitary (line 121) | def is_unitary(self) -> bool:
method is_symbolic (line 125) | def is_symbolic(self) -> bool:
method defined (line 130) | def defined(self):
method tonp (line 134) | def tonp(self):
method tosp (line 138) | def tosp(self):
method random_unitary (line 142) | def random_unitary(n: int) -> MatrixN:
method parametrized_unitary (line 152) | def parametrized_unitary(n: int, parameters: np.ndarray | list) -> Mat...
method _unitarize_matrix (line 167) | def _unitarize_matrix(n: int, u: np.ndarray) -> MatrixN:
method get_unitary_extension (line 176) | def get_unitary_extension(M: np.ndarray) -> MatrixN:
method simp (line 218) | def simp(self):
method _read (line 223) | def _read(seqline: Iterator[str]) -> Matrix:
method fill (line 242) | def fill(self, _: float):
method __getitem__ (line 246) | def __getitem__(self, k):
class MatrixS (line 250) | class MatrixS(Matrix, sp.Matrix):
method __new__ (line 252) | def __new__(cls, obj):
method is_symbolic (line 255) | def is_symbolic(self):
method defined (line 259) | def defined(self):
method tonp (line 262) | def tonp(self):
method tosp (line 265) | def tosp(self):
method T (line 269) | def T(self):
method fill (line 275) | def fill(self, f):
method __getitem__ (line 278) | def __getitem__(self, k):
method conj (line 281) | def conj(self):
method simp (line 287) | def simp(self):
method ndim (line 294) | def ndim(self):
method is_unitary (line 297) | def is_unitary(self):
class MatrixN (line 311) | class MatrixN(np.ndarray, Matrix):
method __new__ (line 313) | def __new__(cls, obj):
method defined (line 319) | def defined(self):
method is_symbolic (line 322) | def is_symbolic(self):
method tonp (line 325) | def tonp(self):
method tosp (line 328) | def tosp(self):
method fill (line 331) | def fill(self, f):
method __getitem__ (line 334) | def __getitem__(self, k):
method is_unitary (line 337) | def is_unitary(self):
method inv (line 343) | def inv(self) -> MatrixN:
function matrix_double (line 351) | def matrix_double(u: Matrix):
FILE: perceval/utils/mlstr.py
function _align (line 33) | def _align(s):
class mlstr (line 39) | class mlstr:
method __init__ (line 44) | def __init__(self, *value):
method __iadd__ (line 47) | def __iadd__(self, s):
method __radd__ (line 58) | def __radd__(self, s):
method __add__ (line 61) | def __add__(self, s):
method __str__ (line 72) | def __str__(self):
method __repr__ (line 75) | def __repr__(self):
method split (line 78) | def split(self, sep):
method height (line 85) | def height(self):
method __mod__ (line 88) | def __mod__(self, args):
method join (line 98) | def join(self, list_str):
FILE: perceval/utils/noise_model.py
class NoiseModel (line 33) | class NoiseModel:
method __init__ (line 61) | def __init__(self,
method __deepcopy__ (line 78) | def __deepcopy__(self, memo):
method __str__ (line 81) | def __str__(self) -> str:
method __repr__ (line 84) | def __repr__(self) -> str:
method __dict__ (line 87) | def __dict__(self) -> dict:
method __eq__ (line 97) | def __eq__(self, other) -> bool:
FILE: perceval/utils/parameter.py
class Parameter (line 40) | class Parameter:
method __init__ (line 53) | def __init__(self, name: str, value: float = None,
method _is_expression (line 73) | def _is_expression(self):
method spv (line 77) | def spv(self) -> sp.Expr:
method is_variable (line 85) | def is_variable(self) -> bool:
method __bool__ (line 89) | def __bool__(self) -> bool:
method __float__ (line 92) | def __float__(self):
method copy (line 97) | def copy(self) -> Parameter:
method evalf (line 100) | def evalf(self, subs: dict = None) -> float:
method is_symbolic (line 107) | def is_symbolic(self) -> bool:
method random (line 110) | def random(self):
method _check_value (line 118) | def _check_value(v: float, min_v: float, max_v: float, periodic: bool):
method check_value (line 130) | def check_value(self, v):
method set_value (line 133) | def set_value(self, v: float, force: bool = False):
method fix_value (line 145) | def fix_value(self, v: float):
method reset (line 153) | def reset(self):
method defined (line 159) | def defined(self) -> bool:
method is_periodic (line 165) | def is_periodic(self) -> bool:
method set_periodic (line 170) | def set_periodic(self, periodic):
method fixed (line 175) | def fixed(self) -> bool:
method __repr__ (line 180) | def __repr__(self):
method bounds (line 186) | def bounds(self) -> tuple[float, float]:
method min (line 192) | def min(self):
method min (line 198) | def min(self, m: float):
method max (line 204) | def max(self) -> float:
method max (line 210) | def max(self, m: bool):
method pid (line 217) | def pid(self):
method __mul__ (line 221) | def __mul__(self, other):
method __rmul__ (line 228) | def __rmul__(self, other):
method __add__ (line 231) | def __add__(self, other):
method __radd__ (line 238) | def __radd__(self, other):
method __sub__ (line 241) | def __sub__(self, other):
method __rsub__ (line 248) | def __rsub__(self, other):
method __truediv__ (line 253) | def __truediv__(self, other):
method __pow__ (line 260) | def __pow__(self, other):
method __neg__ (line 267) | def __neg__(self):
method _merge_param_sets (line 275) | def _merge_param_sets(self, other):
class Expression (line 279) | class Expression(Parameter):
method __init__ (line 295) | def __init__(self, name: str, parameters: set[Parameter]):
method _is_expression (line 311) | def _is_expression(self):
method _check_parameters (line 314) | def _check_parameters(self, free_symbol_names):
method __repr__ (line 319) | def __repr__(self):
method __float__ (line 322) | def __float__(self):
method parameters (line 329) | def parameters(self) -> list[Parameter]:
method is_periodic (line 334) | def is_periodic(self) -> bool:
method defined (line 339) | def defined(self) -> bool:
method fixed (line 345) | def fixed(self) -> bool:
method copy (line 350) | def copy(self) -> Expression:
FILE: perceval/utils/persistent_data.py
class PersistentData (line 41) | class PersistentData:
method __init__ (line 56) | def __init__(self):
method is_writable (line 79) | def is_writable(self) -> bool:
method is_readable (line 86) | def is_readable(self) -> bool:
method _create_directory (line 93) | def _create_directory(self) -> None:
method _safe_create_directory (line 99) | def _safe_create_directory(self) -> bool:
method get_folder_size (line 111) | def get_folder_size(self) -> int:
method get_full_path (line 119) | def get_full_path(self, element_name: str) -> str:
method has_file (line 127) | def has_file(self, filename: str) -> bool:
method delete_file (line 135) | def delete_file(self, filename: str):
method write_file (line 150) | def write_file(self, filename: str, data: bytes | str, file_format: Fi...
method read_file (line 174) | def read_file(self, filename: str, file_format: FileFormat) -> bytes |...
method load_config (line 199) | def load_config(self) -> dict:
method save_config (line 212) | def save_config(self, config: dict):
method clear_all_data (line 224) | def clear_all_data(self):
method directory (line 232) | def directory(self) -> str:
method create_sub_directory (line 239) | def create_sub_directory(self, relative_path: str) -> str:
method _is_subdir_writable (line 263) | def _is_subdir_writable(path_sub_dir):
method _is_subdir_readable (line 267) | def _is_subdir_readable(path_sub_dir):
FILE: perceval/utils/polarization.py
class Polarization (line 49) | class Polarization:
method __init__ (line 58) | def __init__(self,
method __complex__ (line 87) | def __complex__(self):
method parse (line 91) | def parse(s: str) -> Polarization:
method project_eh_ev (line 132) | def project_eh_ev(self, use_symbolic=False) -> tuple[any, any]:
method __str__ (line 144) | def __str__(self):
function _rec_build_spatial_output_states (line 153) | def _rec_build_spatial_output_states(lfs: list, output: list):
function build_spatial_output_states (line 164) | def build_spatial_output_states(state: BasicState):
function _is_orthogonal (line 168) | def _is_orthogonal(v1, v2, use_symbolic):
function convert_polarized_state (line 176) | def convert_polarized_state(state: BasicState,
FILE: perceval/utils/postselect.py
function post_select_distribution (line 37) | def post_select_distribution(
function post_select_statevector (line 76) | def post_select_statevector(
FILE: perceval/utils/progress_cb.py
function partial_progress_callable (line 30) | def partial_progress_callable(progress_cb: callable, min_val: float = 0....
FILE: perceval/utils/qmath.py
function exponentiation_by_squaring (line 34) | def exponentiation_by_squaring(base, power: int):
function distinct_permutations (line 69) | def distinct_permutations(iterable, r=None):
function kmeans (line 171) | def kmeans(features: np.ndarray, n_clusters: int, n_init: int = 10) -> n...
FILE: perceval/utils/stategenerator.py
class StateGenerator (line 39) | class StateGenerator:
method __init__ (line 48) | def __init__(self, encoding, polarization_base = None):
method logical_state (line 67) | def logical_state(self, state: list[int]):
method bell_state (line 86) | def bell_state(self, state: str):
method ghz_state (line 115) | def ghz_state(self, n: int):
method graph_state (line 126) | def graph_state(self, graph: nx.Graph):
method dicke_state (line 164) | def dicke_state(self, n: int, k: int = None) -> StateVector:
method zero_padded_state (line 202) | def zero_padded_state(n: int, m: int = None) -> BasicState:
method periodic_state (line 217) | def periodic_state(n: int, m: int = None) -> BasicState:
method evenly_spaced_state (line 233) | def evenly_spaced_state(n: int, m: int) -> BasicState:
FILE: perceval/utils/states.py
class BasicStateMeta (line 51) | class BasicStateMeta(type):
method __instancecheck__ (line 54) | def __instancecheck__(cls, inst):
method __subclasscheck__ (line 58) | def __subclasscheck__(cls, sub):
class BasicState (line 65) | class BasicState(metaclass=BasicStateMeta):
method __new__ (line 68) | def __new__(cls, fs: FockState):
method __new__ (line 72) | def __new__(cls, fs: NoisyFockState):
method __new__ (line 76) | def __new__(cls, fs: AnnotatedFockState):
method __new__ (line 80) | def __new__(cls):
method __new__ (line 84) | def __new__(cls, photons: list[int]):
method __new__ (line 88) | def __new__(cls, m: int):
method __new__ (line 92) | def __new__(cls, photons: list[int], noise: list[int]):
method __new__ (line 96) | def __new__(cls, source: str):
method m (line 106) | def m(self) -> int:
method n (line 113) | def n(self) -> int:
method __len__ (line 119) | def __len__(self) -> int:
method __eq__ (line 122) | def __eq__(self, other) -> bool:
method __ne__ (line 125) | def __ne__(self, other) -> bool:
method __getitem__ (line 128) | def __getitem__(self, item):
method __mul__ (line 131) | def __mul__(self, other: State | int | float | complex) -> State | Sta...
method __rmul__ (line 134) | def __rmul__(self, other: State | int | float | complex) -> State | St...
method __pow__ (line 137) | def __pow__(self, power) -> State:
method __iter__ (line 140) | def __iter__(self) -> Generator[int, None, None]:
method merge (line 143) | def merge(self, other: State) -> State:
method __add__ (line 152) | def __add__(self, other) -> State | StateVector | BSDistribution:
method __radd__ (line 155) | def __radd__(self, other) -> State | StateVector | BSDistribution:
method __sub__ (line 158) | def __sub__(self, other) -> State | StateVector | BSDistribution:
method __rsub__ (line 161) | def __rsub__(self, other) -> State | StateVector | BSDistribution:
method has_polarization (line 165) | def has_polarization(self) -> bool:
method has_annotations (line 169) | def has_annotations(self) -> bool:
method separate_state (line 172) | def separate_state(self) -> list[FockState]:
method split_state (line 177) | def split_state(self) -> dict[int, FockState]:
method partition (line 183) | def partition(self, photon_nb: list[int]) -> list[list[FockState]]:
method clear_annotations (line 190) | def clear_annotations(self) -> FockState:
method get_mode_annotations (line 195) | def get_mode_annotations(self, mode: int) -> list[Annotation] | list[i...
method get_photon_annotation (line 202) | def get_photon_annotation(self, photon: int) -> Annotation | int:
method inject_annotation (line 208) | def inject_annotation(self, annot: Annotation | int) -> AnnotatedFockS...
method mode2photon (line 215) | def mode2photon(self, mode: int) -> int:
method photon2mode (line 222) | def photon2mode(self, n: int) -> int:
method prodnfact (line 228) | def prodnfact(self) -> float:
method remove_modes (line 233) | def remove_modes(self, modes: list[int]) -> State:
method set_slice (line 239) | def set_slice(self, other: State, start: int, end: int) -> State:
method threshold_detection (line 248) | def threshold_detection(self, nb: int = 1):
function allstate_array (line 255) | def allstate_array(input_state: BasicState, mask: xq.FSMask = None) -> x...
function allstate_iterator (line 268) | def allstate_iterator(input_state: BasicState | StateVector, mask: xq.FS...
function max_photon_state_iterator (line 288) | def max_photon_state_iterator(m: int, n_max: int):
function anonymize_annotations (line 302) | def anonymize_annotations(sv: StateVector, annot_tag: str = "a") -> Stat...
function anonymize_annotations (line 331) | def anonymize_annotations(svd: SVDistribution, annot_tag: str = "a") -> ...
function filter_distribution_photon_count (line 340) | def filter_distribution_photon_count(bsd: BSDistribution, min_photons_fi...
function filter_distribution_photon_count (line 360) | def filter_distribution_photon_count(svd: SVDistribution, min_photons_fi...
FILE: perceval/utils/versions/metadata.py
class PMetadata (line 34) | class PMetadata:
method short_version (line 41) | def short_version() -> str:
method version (line 45) | def version() -> str:
method package_name (line 49) | def package_name() -> str:
method author (line 53) | def author() -> str:
method name (line 57) | def name() -> str:
FILE: perceval/utils/versions/version_utils.py
function keep_latest_versions (line 32) | def keep_latest_versions(versions: list[str], mini: str = None) -> list[...
FILE: setup.py
function getRemoteRoot (line 7) | def getRemoteRoot():
function addRemoteRootToImages (line 28) | def addRemoteRootToImages(content, root):
FILE: tests/_test_utils.py
function strip_line_12 (line 53) | def strip_line_12(s: str) -> str:
function check_sv_close (line 57) | def check_sv_close(sv1: StateVector, sv2: StateVector) -> bool:
function assert_sv_close (line 70) | def assert_sv_close(sv1: StateVector, sv2: StateVector):
function compact_svd (line 80) | def compact_svd(svd: SVDistribution) -> SVDistribution:
function assert_svd_close (line 97) | def assert_svd_close(lhsvd, rhsvd):
function assert_bsd_close (line 116) | def assert_bsd_close(lhbsd, rhbsd):
function assert_circuits_eq (line 125) | def assert_circuits_eq(c_a: Circuit, c_b: Circuit):
function assert_component_list_eq (line 130) | def assert_component_list_eq(comp_a, comp_b):
function assert_detector_list_eq (line 183) | def assert_detector_list_eq(detect_a: list[IDetector], detect_b: list[ID...
function assert_detector_eq (line 191) | def assert_detector_eq(left_detector: IDetector, right_detector: IDetect...
function assert_experiment_equals (line 201) | def assert_experiment_equals(experiment1: Experiment, experiment2: Exper...
function assert_compiled_circuit_equals (line 217) | def assert_compiled_circuit_equals(cc_1: CompiledCircuit, cc_2: Compiled...
function dict2svd (line 224) | def dict2svd(d: dict):
function save_figs (line 229) | def save_figs(pytestconfig):
function _norm (line 233) | def _norm(svg):
function _check_svg (line 242) | def _check_svg(test_path, ref_path, collection: str):
function _check_circuit (line 260) | def _check_circuit(test_path, ref_path):
function _check_qpt (line 264) | def _check_qpt(test_path, ref_path):
function _save_or_check (line 268) | def _save_or_check(c, tmp_path, circuit_name, save_figs, recursive=False...
class LogChecker (line 300) | class LogChecker:
method __init__ (line 314) | def __init__(self, mock_warn: MagicMock, log_channel: channel = channe...
method __enter__ (line 321) | def __enter__(self):
method __exit__ (line 331) | def __exit__(self, exc_type, exc_val, exc_tb):
method set_expected_log_number (line 350) | def set_expected_log_number(self, expected_log_number: int):
function retry (line 358) | def retry(exception_to_check: type[Exception], tries: int = 4, delay: fl...
FILE: tests/algorithm/test_analyzer.py
function test_analyzer_on_qrng (line 41) | def test_analyzer_on_qrng():
function test_analyzer_bs_1 (line 92) | def test_analyzer_bs_1():
function test_analyzer_bs_2 (line 102) | def test_analyzer_bs_2():
FILE: tests/algorithm/test_sampler.py
function test_sampler_standard (line 42) | def test_sampler_standard(backend_name):
function test_sampler_missing_input_state (line 59) | def test_sampler_missing_input_state():
function test_sampler_iteration_missing_input_state (line 73) | def test_sampler_iteration_missing_input_state():
function test_sampler_iteration_bad_params (line 88) | def test_sampler_iteration_bad_params():
function test_sampler_clear_iterations (line 107) | def test_sampler_clear_iterations():
function test_sampler_iterator (line 132) | def test_sampler_iterator(backend_name):
function test_iterator_with_heralds (line 197) | def test_iterator_with_heralds():
function test_sampler_shots (line 221) | def test_sampler_shots(backend_name):
FILE: tests/algorithm/test_tomography.py
function test_density_matrix_state_tomography (line 52) | def test_density_matrix_state_tomography(pauli_gate):
function fidelity_op_process_tomography (line 65) | def fidelity_op_process_tomography(op, op_proc):
function test_fidelity_klm_cnot (line 77) | def test_fidelity_klm_cnot():
function test_fidelity_postprocessed_cnot (line 85) | def test_fidelity_postprocessed_cnot():
function test_fidelity_random_op (line 93) | def test_fidelity_random_op():
function test_processor_odd_modes (line 115) | def test_processor_odd_modes():
function test_chi_cnot_is_physical (line 122) | def test_chi_cnot_is_physical():
function test_pauli_order (line 135) | def test_pauli_order():
function test_generate_pauli (line 139) | def test_generate_pauli():
function test_utils_vector_to_sq_matrix (line 145) | def test_utils_vector_to_sq_matrix():
function test_matrix_to_vector (line 154) | def test_matrix_to_vector():
function test_matrix_basis_n_decomp (line 159) | def test_matrix_basis_n_decomp():
function test_avg_fidelity_postprocessed_ccz_gate (line 179) | def test_avg_fidelity_postprocessed_ccz_gate():
FILE: tests/algorithm/test_tomography_mle.py
function fidelity_op_mle_process_tomography (line 46) | def fidelity_op_mle_process_tomography(op_proc):
function test_fidelity_heralded_cnot (line 58) | def test_fidelity_heralded_cnot():
function test_ghz_state_tomography_mle (line 65) | def test_ghz_state_tomography_mle():
function test_chi_cnot_from_mle_is_physical (line 83) | def test_chi_cnot_from_mle_is_physical():
FILE: tests/backends/test_backends.py
function _assert_cnot (line 39) | def _assert_cnot(backend: AStrongSimulationBackend):
function test_clifford_bs (line 58) | def test_clifford_bs():
function check_output_distribution (line 70) | def check_output_distribution(backend: AStrongSimulationBackend, input_s...
function test_backend_factory_default (line 84) | def test_backend_factory_default():
function test_backend_wiring (line 92) | def test_backend_wiring(backend_name):
function test_backend_identity (line 98) | def test_backend_identity(backend_name):
function test_backend_wrong_size (line 107) | def test_backend_wrong_size(backend_name):
function test_backend_sym_bs (line 117) | def test_backend_sym_bs(backend_name):
function test_backend_asym_bs (line 133) | def test_backend_asym_bs(backend_name):
function test_slos_precomputation (line 145) | def test_slos_precomputation():
function test_slos_symbolic (line 160) | def test_slos_symbolic():
function test_backend_cnot (line 171) | def test_backend_cnot(backend_name):
function test_cnot_with_mask (line 189) | def test_cnot_with_mask(backend_name):
function test_strong_sim_with_mask (line 204) | def test_strong_sim_with_mask(backend_name):
function test_probampli_backends (line 222) | def test_probampli_backends(backend_name):
function test_slos_refresh_coefs (line 252) | def test_slos_refresh_coefs():
function test_evolve_indistinguishable (line 281) | def test_evolve_indistinguishable(backend_name):
function test_backend_mps_n_mode_perm_decomp (line 292) | def test_backend_mps_n_mode_perm_decomp():
function test_probampli_iterator_cache (line 314) | def test_probampli_iterator_cache(backend_name):
FILE: tests/components/catalog/test_1_qubit_gates.py
function test_single_qubit_phase_gates (line 38) | def test_single_qubit_phase_gates(gate_name, exptd_phi):
function test_pauli_y_gate (line 49) | def test_pauli_y_gate():
function test_ry_gate (line 62) | def test_ry_gate():
function test_rz_gate (line 69) | def test_rz_gate():
function test_rx_gate (line 79) | def test_rx_gate():
function test_single_qubit_gates (line 87) | def test_single_qubit_gates(gate_name, lo_comp):
FILE: tests/components/catalog/test_2qbits_gates.py
function test_fidelity_and_performance_cnot (line 39) | def test_fidelity_and_performance_cnot():
function check_cz_with_heralds_or_ancillaries (line 69) | def check_cz_with_heralds_or_ancillaries(processor, herald_states, error...
function test_cz_and_cnot_phases_and_modulus (line 116) | def test_cz_and_cnot_phases_and_modulus():
function test_inverted_cnot (line 144) | def test_inverted_cnot(cnot_gate):
FILE: tests/components/catalog/test_pauli.py
function test_pauli_type (line 36) | def test_pauli_type():
function test_pauli_state_prep_circuits (line 45) | def test_pauli_state_prep_circuits(pauli_eigen_states):
function test_pauli_gates (line 51) | def test_pauli_gates(pauli_gate):
function test_processor_circuit_configurator (line 56) | def test_processor_circuit_configurator():
FILE: tests/components/catalog/test_qloq.py
function test_internal_swap (line 38) | def test_internal_swap():
function test_rotations_qloq (line 59) | def test_rotations_qloq():
function test_internal_entanglement (line 90) | def test_internal_entanglement():
FILE: tests/components/test_circuit.py
function test_helloword (line 45) | def test_helloword():
function test_empty_circuit (line 127) | def test_empty_circuit():
function test_bs_symbolic_unitary (line 148) | def test_bs_symbolic_unitary():
function test_bs_u (line 157) | def test_bs_u():
function test_symbolic_theta_in_beam_splitter (line 168) | def test_symbolic_theta_in_beam_splitter():
function test_double_parameter_ok (line 178) | def test_double_parameter_ok():
function test_double_parameter_dup (line 183) | def test_double_parameter_dup():
function test_double_parameter_dup_multi (line 190) | def test_double_parameter_dup_multi():
function test_build_composition (line 197) | def test_build_composition():
function test_build_composition_2 (line 204) | def test_build_composition_2():
function test_build_composition_3 (line 209) | def test_build_composition_3():
function test_build_composition_4 (line 214) | def test_build_composition_4():
function test_out_of_bound_composition (line 219) | def test_out_of_bound_composition():
function test_unitary_component (line 226) | def test_unitary_component():
function test_unitary_inverse (line 240) | def test_unitary_inverse():
function test_iterator (line 266) | def test_iterator():
function _generate_simple_circuit (line 284) | def _generate_simple_circuit():
function test_visualization_ucircuit (line 290) | def test_visualization_ucircuit(capfd):
function test_visualization_barrier (line 307) | def test_visualization_barrier(capfd):
function test_depths_ncomponents (line 333) | def test_depths_ncomponents():
function test_reflexivity (line 351) | def test_reflexivity():
function test_getitem1_index (line 356) | def test_getitem1_index():
function test_getitem2_value (line 366) | def test_getitem2_value():
function test_getitem3_parameter (line 372) | def test_getitem3_parameter():
function test_describe (line 377) | def test_describe():
function test_copy (line 392) | def test_copy():
FILE: tests/components/test_compiled_circuit.py
function test_inheritance (line 36) | def test_inheritance():
function test_compute_unitary (line 43) | def test_compute_unitary():
FILE: tests/components/test_compute_unitary.py
function _check_unitary (line 35) | def _check_unitary(component: pcvl.ACircuit):
function test_BS_unitary (line 43) | def test_BS_unitary():
function test_PS_unitary (line 52) | def test_PS_unitary():
function test_WP_unitary (line 57) | def test_WP_unitary():
function test_PR_unitary (line 62) | def test_PR_unitary():
FILE: tests/components/test_controlled_gates.py
function check_controlled_gates_and_get_performance (line 39) | def check_controlled_gates_and_get_performance(n, alpha, processor, hera...
function test_controlled_gates (line 85) | def test_controlled_gates():
function test_ccz_and_toffoli_phases_and_modulus (line 94) | def test_ccz_and_toffoli_phases_and_modulus():
function test_inverted_sub_cnot (line 123) | def test_inverted_sub_cnot():
FILE: tests/components/test_decomposition.py
function test_perm_0 (line 42) | def test_perm_0():
function test_basic_perm_triangle (line 54) | def test_basic_perm_triangle():
function test_basic_perm_triangle_bs (line 64) | def test_basic_perm_triangle_bs():
function test_basic_perm_rectangle (line 75) | def test_basic_perm_rectangle():
function test_perm_triangle (line 86) | def test_perm_triangle():
function test_perm_rectangle_bs_0 (line 94) | def test_perm_rectangle_bs_0():
function test_perm_rectangle_bs_1 (line 107) | def test_perm_rectangle_bs_1():
function test_id_decomposition_rectangle (line 120) | def test_id_decomposition_rectangle():
function test_id_decomposition_triangle (line 129) | def test_id_decomposition_triangle():
function test_any_unitary_triangle (line 148) | def test_any_unitary_triangle():
function test_any_unitary_rectangle (line 157) | def test_any_unitary_rectangle():
function test_simple_phase (line 172) | def test_simple_phase():
function test_decompose_non_unitary (line 180) | def test_decompose_non_unitary():
function test_decomposition_large (line 187) | def test_decomposition_large():
function test_decomposition_perm (line 196) | def test_decomposition_perm():
function test_decomposition_inverse_rx (line 202) | def test_decomposition_inverse_rx():
function test_decomposition_inverse_h (line 216) | def test_decomposition_inverse_h():
FILE: tests/components/test_detectors.py
function test_detector (line 41) | def test_detector():
function test_interleaved_ppnr (line 62) | def test_interleaved_ppnr():
function test_bs_layered_ppnr (line 120) | def test_bs_layered_ppnr():
function test_bs_layered_ppnr_circuit (line 142) | def test_bs_layered_ppnr_circuit():
function test_bs_layered_ppnr_bad_usage (line 159) | def test_bs_layered_ppnr_bad_usage():
function test_detection_type (line 170) | def test_detection_type():
function test_incompatible_heralds (line 183) | def test_incompatible_heralds(mock_warn):
FILE: tests/components/test_ff_configurator.py
function test_generic (line 36) | def test_generic():
function test_ff_circuit_provider (line 55) | def test_ff_circuit_provider():
function test_ff_circuit_provider_failures (line 74) | def test_ff_circuit_provider_failures():
function test_ffconfigurator (line 86) | def test_ffconfigurator():
function test_ffconfigurator_failures (line 105) | def test_ffconfigurator_failures():
FILE: tests/components/test_generic_interferometer.py
function test_variable_parameters_count (line 43) | def test_variable_parameters_count():
function test_set_identity (line 62) | def test_set_identity(interferometer):
function test_set_param_list (line 71) | def test_set_param_list():
function test_set_params_from_other (line 111) | def test_set_params_from_other():
FILE: tests/components/test_loss_channel.py
function test_lc_minimal (line 46) | def test_lc_minimal():
function test_lc_commutative (line 58) | def test_lc_commutative():
function test_lc_source_losses_equivalence (line 69) | def test_lc_source_losses_equivalence():
function test_lc_empty_modes (line 80) | def test_lc_empty_modes():
FILE: tests/components/test_match.py
function setup_function (line 41) | def setup_function(_):
function teardown_function (line 47) | def teardown_function(_):
function _bs_rx (line 52) | def _bs_rx(r):
function _bs_h (line 55) | def _bs_h(r):
function test_match_elementary (line 58) | def test_match_elementary():
function test_match_nomatch (line 66) | def test_match_nomatch():
function test_match_perm (line 71) | def test_match_perm():
function test_match_double (line 81) | def test_match_double():
function test_match_rec (line 94) | def test_match_rec():
function test_match_rec_inv (line 105) | def test_match_rec_inv():
function test_match_simple_seq (line 112) | def test_match_simple_seq():
function test_subnodes_0 (line 120) | def test_subnodes_0():
function test_match_rewrite_phase (line 140) | def test_match_rewrite_phase():
function test_match_switch_phases (line 153) | def test_match_switch_phases():
FILE: tests/components/test_mode_connector.py
function test_connection_resolver_init (line 41) | def test_connection_resolver_init():
function test_connection_int (line 55) | def test_connection_int():
function test_connection_list_int (line 70) | def test_connection_list_int():
function test_connection_dict_int (line 97) | def test_connection_dict_int():
function test_connection_dict_str (line 115) | def test_connection_dict_str():
FILE: tests/components/test_permutation.py
function test_permutation_3 (line 40) | def test_permutation_3():
function test_permutation_inverse (line 63) | def test_permutation_inverse():
function test_n_mode_permutation_in_2_mode_perms (line 79) | def test_n_mode_permutation_in_2_mode_perms(perm_list):
function test_random_perm_breakup_run_multiple (line 91) | def test_random_perm_breakup_run_multiple(ith_run):
function test_circuit_decompose_perms (line 104) | def test_circuit_decompose_perms():
FILE: tests/components/test_port.py
function test_basic_state_conversion (line 36) | def test_basic_state_conversion():
FILE: tests/components/test_processor.py
function test_processor_input_fock_state (line 44) | def test_processor_input_fock_state(mock_warn):
function test_processor_input_fock_state_with_loss (line 51) | def test_processor_input_fock_state_with_loss():
function test_processor_input_fock_state_with_all_noise_sources (line 63) | def test_processor_input_fock_state_with_all_noise_sources():
function test_processor_input_state_vector (line 95) | def test_processor_input_state_vector():
function test_processor_probs (line 107) | def test_processor_probs():
function test_processor_samples (line 130) | def test_processor_samples():
function test_processor_samples_max_shots (line 145) | def test_processor_samples_max_shots():
function test_add_remove_ports (line 165) | def test_add_remove_ports():
function test_phase_quantization (line 231) | def test_phase_quantization():
function test_phase_error (line 255) | def test_phase_error():
function test_empty_output (line 287) | def test_empty_output():
function test_mask_distinguishability (line 298) | def test_mask_distinguishability():
function test_mask_detectors (line 311) | def test_mask_detectors():
function test_min_photons_reset (line 335) | def test_min_photons_reset():
function test_flatten_processor (line 352) | def test_flatten_processor():
function test_asymmetric_processor (line 379) | def test_asymmetric_processor():
function test_get_parameters (line 416) | def test_get_parameters():
FILE: tests/components/test_processor_composition.py
function test_processor_composition (line 42) | def test_processor_composition():
function test_composition_error_post_selection (line 53) | def test_composition_error_post_selection():
function test_processor_composition_mismatch_modes (line 68) | def test_processor_composition_mismatch_modes():
function test_processor_add_detector (line 107) | def test_processor_add_detector():
function test_remote_processor_creation (line 116) | def test_remote_processor_creation():
function test_processor_composition_ports (line 121) | def test_processor_composition_ports():
function test_processor_building_feed_forward (line 145) | def test_processor_building_feed_forward():
function test_processor_feed_forward_multiple_layers (line 170) | def test_processor_feed_forward_multiple_layers():
function test_ff_controlled_circuit_size (line 191) | def test_ff_controlled_circuit_size():
function test_asymmetrical_composition (line 206) | def test_asymmetrical_composition():
function test_detector_composition (line 227) | def test_detector_composition():
FILE: tests/components/test_source.py
function test_source_pure (line 41) | def test_source_pure():
function test_source_emission (line 53) | def test_source_emission():
function test_source_emission_g2 (line 59) | def test_source_emission_g2():
function test_source_emission_g2_losses_indistinguishable (line 65) | def test_source_emission_g2_losses_indistinguishable():
function test_source_indistinguishability (line 73) | def test_source_indistinguishability():
function test_source_multiple_photons_per_mode (line 88) | def test_source_multiple_photons_per_mode():
function test_source_sample_no_filter (line 100) | def test_source_sample_no_filter():
function test_source_samples_with_filter (line 154) | def test_source_samples_with_filter(brightness, g2, hom, losses, multiph...
FILE: tests/components/test_time_delay.py
function test_without_herald (line 39) | def test_without_herald():
function test_with_selection (line 53) | def test_with_selection():
function test_with_heralds (line 71) | def test_with_heralds():
FILE: tests/components/test_transfer.py
function test_basic_transfer (line 40) | def test_basic_transfer():
function test_basic_transfer_fix (line 48) | def test_basic_transfer_fix():
function test_transfer_complex_1 (line 58) | def test_transfer_complex_1():
function test_transfer_complex_2 (line 70) | def test_transfer_complex_2():
function test_transfer_complex_3 (line 83) | def test_transfer_complex_3():
function test_transfer_complex_4 (line 96) | def test_transfer_complex_4():
function test_transfer_complex_5 (line 117) | def test_transfer_complex_5():
FILE: tests/components/test_unitary_determinant.py
function test_determinant_base (line 36) | def test_determinant_base():
function test_determinant_generic (line 41) | def test_determinant_generic():
function test_determinant_1 (line 46) | def test_determinant_1():
function test_determinant_2 (line 51) | def test_determinant_2():
FILE: tests/error_mitigation/test_loss_mitigation.py
function _sampler_setup_cnot (line 43) | def _sampler_setup_cnot(output_type: str):
function test_photon_loss_mitigation (line 67) | def test_photon_loss_mitigation(result_type):
function test_input_validation_loss_mitigation (line 78) | def test_input_validation_loss_mitigation():
function _compute_random_circ_probs (line 120) | def _compute_random_circ_probs(source_emission, num_photons):
function test_mitigation_over_postselect_tvd (line 141) | def test_mitigation_over_postselect_tvd():
FILE: tests/rendering/test_rendering.py
function test_display_config (line 39) | def test_display_config(mock_save_config, mock_load_config):
FILE: tests/rendering/test_visualization.py
function test_svg_dump_phys_bs (line 51) | def test_svg_dump_phys_bs(tmp_path, save_figs):
function test_svg_dump_phys_ps (line 56) | def test_svg_dump_phys_ps(tmp_path, save_figs):
function test_svg_dump_phys_pbs (line 61) | def test_svg_dump_phys_pbs(tmp_path, save_figs):
function test_svg_dump_phys_dt (line 66) | def test_svg_dump_phys_dt(tmp_path, save_figs):
function test_svg_dump_phys_wp (line 71) | def test_svg_dump_phys_wp(tmp_path, save_figs):
function test_svg_dump_phys_hwp (line 76) | def test_svg_dump_phys_hwp(tmp_path, save_figs):
function test_svg_dump_phys_qwp (line 81) | def test_svg_dump_phys_qwp(tmp_path, save_figs):
function test_svg_dump_phys_pr (line 86) | def test_svg_dump_phys_pr(tmp_path, save_figs):
function test_svg_dump_phys_perm4_0 (line 91) | def test_svg_dump_phys_perm4_0(tmp_path, save_figs):
function test_svg_dump_phys_perm4_inv (line 96) | def test_svg_dump_phys_perm4_inv(tmp_path, save_figs):
function test_svg_dump_phys_perm4_swap (line 101) | def test_svg_dump_phys_perm4_swap(tmp_path, save_figs):
function test_svg_dump_no_circuit_4 (line 106) | def test_svg_dump_no_circuit_4(tmp_path, save_figs):
function test_svg_dump_symb_bs_compact (line 111) | def test_svg_dump_symb_bs_compact(tmp_path, save_figs):
function test_svg_dump_symb_bs_compact_false (line 117) | def test_svg_dump_symb_bs_compact_false(tmp_path, save_figs):
function test_svg_dump_symb_ps (line 123) | def test_svg_dump_symb_ps(tmp_path, save_figs):
function test_svg_dump_symb_pbs_compact (line 128) | def test_svg_dump_symb_pbs_compact(tmp_path, save_figs):
function test_svg_dump_symb_pbs_compact_false (line 133) | def test_svg_dump_symb_pbs_compact_false(tmp_path, save_figs):
function test_svg_dump_symb_pr (line 138) | def test_svg_dump_symb_pr(tmp_path, save_figs):
function test_svg_dump_symb_wp (line 143) | def test_svg_dump_symb_wp(tmp_path, save_figs):
function test_svg_dump_symb_hwp (line 148) | def test_svg_dump_symb_hwp(tmp_path, save_figs):
function test_svg_dump_symb_qwp (line 153) | def test_svg_dump_symb_qwp(tmp_path, save_figs):
function test_svg_dump_phys_multi_perm (line 158) | def test_svg_dump_phys_multi_perm(tmp_path, save_figs):
function _create_qrng (line 168) | def _create_qrng():
function test_svg_dump_qrng (line 189) | def test_svg_dump_qrng(tmp_path, save_figs):
function test_svg_dump_qrng_compact (line 195) | def test_svg_dump_qrng_compact(tmp_path, save_figs):
function test_svg_dump_phys_universal1 (line 201) | def test_svg_dump_phys_universal1(tmp_path, save_figs):
function test_svg_dump_unitary (line 207) | def test_svg_dump_unitary(tmp_path, save_figs):
function test_svg_dump_grover (line 220) | def test_svg_dump_grover(tmp_path, save_figs):
function test_svg_bs_based_generic_no_phase_rectangle (line 265) | def test_svg_bs_based_generic_no_phase_rectangle(tmp_path, save_figs):
function test_svg_bs_based_generic_with_phase_rectangle (line 273) | def test_svg_bs_based_generic_with_phase_rectangle(tmp_path, save_figs):
function test_svg_mzi_based_generic_triangle (line 283) | def test_svg_mzi_based_generic_triangle(tmp_path, save_figs):
function test_svg_decomposition_symb_compact (line 292) | def test_svg_decomposition_symb_compact(tmp_path, save_figs):
function test_svg_processor_with_heralds_phys (line 299) | def test_svg_processor_with_heralds_phys(tmp_path, save_figs):
function test_svg_processor_with_heralds_phys_not_recursive (line 309) | def test_svg_processor_with_heralds_phys_not_recursive(tmp_path, save_fi...
function test_svg_processor_with_heralds_margin_overflow_left_phys (line 319) | def test_svg_processor_with_heralds_margin_overflow_left_phys(tmp_path, ...
function test_svg_processor_with_heralds_margin_overflow_right_phys (line 327) | def test_svg_processor_with_heralds_margin_overflow_right_phys(tmp_path,...
function test_svg_processor_with_heralds_margin_overflow_left_right_phys (line 336) | def test_svg_processor_with_heralds_margin_overflow_left_right_phys(tmp_...
function test_svg_processor_with_heralds_perm_following_phys (line 344) | def test_svg_processor_with_heralds_perm_following_phys(tmp_path, save_f...
function test_svg_processor_with_heralds_and_barriers_phys (line 353) | def test_svg_processor_with_heralds_and_barriers_phys(tmp_path, save_figs):
function test_svg_dump_barrier_phys (line 365) | def test_svg_dump_barrier_phys(tmp_path, save_figs):
function test_svg_dump_barrier_symb (line 371) | def test_svg_dump_barrier_symb(tmp_path, save_figs):
function test_svg_dump_circuit_box_bell_state (line 380) | def test_svg_dump_circuit_box_bell_state(tmp_path, save_figs,
function create_processor_with_feed_forward (line 415) | def create_processor_with_feed_forward():
function test_svg_dump_feed_forward_symb (line 437) | def test_svg_dump_feed_forward_symb(tmp_path, save_figs):
function test_svg_dump_feed_forward_phys (line 443) | def test_svg_dump_feed_forward_phys(tmp_path, save_figs):
function test_svg_dump_feed_forward_phys_norec (line 448) | def test_svg_dump_feed_forward_phys_norec(tmp_path, save_figs):
function test_svg_dump_compiled_circuit_no_template (line 453) | def test_svg_dump_compiled_circuit_no_template(tmp_path, save_figs):
function test_svg_dump_compiled_circuit_no_template_symb (line 458) | def test_svg_dump_compiled_circuit_no_template_symb(tmp_path, save_figs):
function test_svg_dump_compiled_circuit_with_template (line 463) | def test_svg_dump_compiled_circuit_with_template(tmp_path, save_figs):
function test_svg_dump_compiled_circuit_with_template_recursive (line 469) | def test_svg_dump_compiled_circuit_with_template_recursive(tmp_path, sav...
function test_svg_dump_compiled_circuit_with_template_experiment (line 475) | def test_svg_dump_compiled_circuit_with_template_experiment(tmp_path, sa...
FILE: tests/rendering/test_visualization_ide.py
function test_ide_visualization (line 38) | def test_ide_visualization(capfd):
FILE: tests/runtime/_mock_rpc_handler.py
class CloudEndpoint (line 99) | class CloudEndpoint(Enum):
method from_response (line 108) | def from_response(response: responses.Response) -> CloudEndpoint:
class RPCHandlerResponsesBuilder (line 125) | class RPCHandlerResponsesBuilder():
method __init__ (line 133) | def __init__(self,
method set_default_job_status (line 153) | def set_default_job_status(self, default_job_status: RunningStatus | N...
method set_job_status_sequence (line 161) | def set_job_status_sequence(self, job_status_sequence: list[RunningSta...
method _set_default_responses (line 169) | def _set_default_responses(self, use_new_platform_details_url: bool = ...
method _reset_default_responses (line 191) | def _reset_default_responses(self) -> None:
method _get_job_status (line 207) | def _get_job_status(self):
method _create_job_callback (line 216) | def _create_job_callback(self, request: requests.PreparedRequest) -> t...
method _set_rerun_job_responses (line 230) | def _set_rerun_job_responses(self, job_id: str, status: RunningStatus ...
method _set_cancel_job_responses (line 244) | def _set_cancel_job_responses(self, job_id: str, status: RunningStatus...
method get_job_status_response_body_from_job_status (line 258) | def get_job_status_response_body_from_job_status(self, status: Running...
method _set_job_status_responses (line 281) | def _set_job_status_responses(self, job_id: str, status: RunningStatus...
method set_job_status_custom_responses (line 288) | def set_job_status_custom_responses(self, response: json) -> None:
method set_job_availability_count (line 291) | def set_job_availability_count(self, count: int) -> None:
method remove_job_status_custom_responses (line 296) | def remove_job_status_custom_responses(self) -> None:
method get_job_result_response_body_from_job_status (line 299) | def get_job_result_response_body_from_job_status(self, status: Running...
method _set_job_result_responses (line 308) | def _set_job_result_responses(self, job_id: str, status: RunningStatus...
method _set_get_platform_details_responses (line 315) | def _set_get_platform_details_responses(self) -> None:
method _set_get_new_platform_details_responses (line 322) | def _set_get_new_platform_details_responses(self, status: int) -> None:
method _set_job_availability_responses (line 329) | def _set_job_availability_responses(self) -> None:
method _reset_job_availability_responses (line 336) | def _reset_job_availability_responses(self) -> None:
function get_rpc_handler_for_tests (line 342) | def get_rpc_handler_for_tests(name: str = "sim:test", url: str = "https:...
FILE: tests/runtime/test_job.py
function quadratic_count_down (line 43) | def quadratic_count_down(n, period=PERIOD, progress_callback=None):
function test_run_sync_0 (line 55) | def test_run_sync_0():
function test_run_sync_1 (line 61) | def test_run_sync_1(mock_warn):
function test_run_async (line 78) | def test_run_async():
function test_run_async_fail (line 100) | def test_run_async_fail(mock_warn):
function test_run_async_cancel (line 119) | def test_run_async_cancel():
function test_get_res_run_async (line 128) | def test_get_res_run_async():
FILE: tests/runtime/test_job_group.py
function test_init (line 54) | def test_init(mock_write_file):
function test_load (line 62) | def test_load(mock_write_file: MagicMock):
function test_add (line 100) | def test_add(mock_write_file):
function test_add_errors (line 137) | def test_add_errors(mock_write_file):
function test_classic_run (line 154) | def test_classic_run(mock_write_file):
function test_save_on_error (line 244) | def test_save_on_error(mock_write_file):
function test_run_advance (line 272) | def test_run_advance(mock_write_file):
function test_rerun (line 304) | def test_rerun(mock_write_file):
function test_launch_async (line 342) | def test_launch_async(mock_write_file):
function test_cancel_all (line 388) | def test_cancel_all(mock_write_file):
FILE: tests/runtime/test_payload_generation.py
function _get_remote_processor (line 41) | def _get_remote_processor(m: int = 8):
function test_payload_basics (line 45) | def test_payload_basics():
function test_payload_parameters (line 60) | def test_payload_parameters():
function test_payload_cnot (line 74) | def test_payload_cnot():
function test_payload_generator (line 104) | def test_payload_generator():
FILE: tests/runtime/test_remote_config.py
function test_remote_config_env_var_vs_cache (line 52) | def test_remote_config_env_var_vs_cache(tmp_path, monkeypatch):
function test_remote_config_from_file (line 86) | def test_remote_config_from_file(tmp_path, monkeypatch):
function test_config_file_access (line 138) | def test_config_file_access(tmp_path, monkeypatch):
FILE: tests/runtime/test_remote_job.py
function test_remote_job (line 52) | def test_remote_job(mock_warn):
function test_get_status_response_resilience (line 95) | def test_get_status_response_resilience(mock_warn):
function test_mock_remote_with_gates (line 134) | def test_mock_remote_with_gates(catalog_item):
function test_remote_with_gates_probs (line 158) | def test_remote_with_gates_probs(catalog_item):
function test_remote_with_gates_samples (line 202) | def test_remote_with_gates_samples(catalog_item):
FILE: tests/runtime/test_rpc_handler.py
function test_create_job (line 54) | def test_create_job():
function test_get_job_infos (line 73) | def test_get_job_infos():
function test_cancel_rerun_job (line 117) | def test_cancel_rerun_job():
function test_get_platform_details (line 173) | def test_get_platform_details():
function test_get_platform_details_with_architecture (line 184) | def test_get_platform_details_with_architecture():
FILE: tests/runtime/test_shots_estimate.py
class _MockRemoteProcessor (line 36) | class _MockRemoteProcessor(RemoteProcessor):
method __init__ (line 37) | def
Copy disabled (too large)
Download .json
Condensed preview — 418 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (12,867K chars).
[
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 860,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Prerequisite**"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 716,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Prerequisit"
},
{
"path": ".github/rendering_requirements.txt",
"chars": 105,
"preview": "contourpy\ncycler\ndrawsvg\nfonttools\nkiwisolver\nlatexcodec\nmatplotlib\npillow\npyparsing\npython-dateutil\nsix\n"
},
{
"path": ".github/workflows/autotests.yml",
"chars": 4583,
"preview": "# This workflow will install Python dependencies, run tests and lint with a variety of Python versions\n# For more inform"
},
{
"path": ".github/workflows/benchmarks.yml",
"chars": 7160,
"preview": "# this is a manual workflow that compare benchmarks with the same runner and the same version of python\n# choose runner,"
},
{
"path": ".github/workflows/build-and-deploy-docs.yml",
"chars": 1492,
"preview": "# This is a basic workflow that is manually triggered\n\nname: Build and deploy docs\n\n# Controls when the action will run."
},
{
"path": ".github/workflows/python-publish.yml",
"chars": 1090,
"preview": "# This workflow will upload a Python Package using Twine when a release is created\n# For more information see: https://h"
},
{
"path": ".github/workflows/rerun-notebooks-and-build-docs.yml",
"chars": 3066,
"preview": "\n# This is a basic workflow that is manually triggered\n\nname: Rerun notebooks and build docs\n\n# Controls when the action"
},
{
"path": ".github/workflows/rerun_notebooks.sh",
"chars": 990,
"preview": "my_function () {\n echo converting $notebook\n jupyter nbconvert --clear-output --inplace \"$notebook\"\n jupyter nb"
},
{
"path": ".gitignore",
"chars": 136,
"preview": ".pytest_cache\n__pycache__\nperceval_quandela.egg-info\nbuild\n.eggs/\ndist/\n.idea/\nvenv*\n*.whl\n.ipynb_checkpoints/\n.coverage"
},
{
"path": ".pre-commit-config.yaml",
"chars": 1010,
"preview": "# See https://pre-commit.com/hooks.html for more hooks\nrepos:\n- repo: https://github.com/pre-commit/pre-commit-hooks\n "
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5227,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
},
{
"path": "CONTRIBUTING.md",
"chars": 2333,
"preview": "# Contributing\n\n*Thanks for being there!*\n\nThere are many ways you can help in the Perceval project. This document will "
},
{
"path": "LICENSE",
"chars": 1505,
"preview": "MIT License\n\nCopyright (c) 2022 Quandela\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
},
{
"path": "README.md",
"chars": 4013,
"preview": "[](https://github.com/Quan"
},
{
"path": "benchmark/benchmark-circuit-building.py",
"chars": 4163,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "benchmark/benchmark-unitary.py",
"chars": 2657,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "benchmark/benchmark_QML-DE-solver.py",
"chars": 4911,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "benchmark/benchmark_bosonsampling.py",
"chars": 2526,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "benchmark/benchmark_pdisplay.py",
"chars": 2830,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "benchmark/benchmark_stepper.py",
"chars": 3532,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "conftest.py",
"chars": 443,
"preview": "import pytest\n\n\ndef pytest_addoption(parser):\n parser.addoption(\"--skip-long-test\", action=\"store_true\",\n "
},
{
"path": "docs/Makefile",
"chars": 762,
"preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the "
},
{
"path": "docs/make.bat",
"chars": 804,
"preview": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sp"
},
{
"path": "docs/multiversion_config/conf.py",
"chars": 3028,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "docs/requirements.txt",
"chars": 223,
"preview": "wheel\nsphinx==6.2.1\nsphinx_rtd_theme\nsphinxcontrib-bibtex\nsphinx_autodoc_typehints\nenum-tools[sphinx]\nnbsphinx\njinja2==3"
},
{
"path": "docs/source/_static/css/style.css",
"chars": 81,
"preview": "@import url(\"theme.css\");\n\n.wy-nav-content {\n max-width: 1200px !important;\n}\n"
},
{
"path": "docs/source/_templates/layout.html",
"chars": 797,
"preview": "{% extends \"!layout.html\" %}\n\n{% block extrahead %}\n{{ super() }}\n<!-- Google Tag Manager -->\n<script>(function(w,d,s,l,"
},
{
"path": "docs/source/_templates/page.html",
"chars": 504,
"preview": "{% extends \"!page.html\" %} {% block body %} {% if current_version and\nlatest_version and current_version != latest_versi"
},
{
"path": "docs/source/_templates/versions.html",
"chars": 811,
"preview": "{%- if current_version %}\n<div\n class=\"rst-versions\"\n data-toggle=\"rst-versions\"\n role=\"note\"\n aria-label=\"versions\""
},
{
"path": "docs/source/backends.rst",
"chars": 9957,
"preview": "Simulation Back-ends\n====================\n\nTo run a simulation, computing back-ends implemented from state of the art al"
},
{
"path": "docs/source/bibliography.rst",
"chars": 54,
"preview": "Bibliography\n============\n\n.. bibliography::\n :all:\n"
},
{
"path": "docs/source/build_catalog.py",
"chars": 2723,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "docs/source/conf.py",
"chars": 4738,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "docs/source/contributing.rst",
"chars": 1408,
"preview": "Contributions\n=============\n\nInitial Contributors\n--------------------\n\nThe first contributors to the frameworks are (al"
},
{
"path": "docs/source/examples_boson_sampling.rst",
"chars": 136,
"preview": "Boson Sampling\n==============\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/Boson_sampling\n notebooks/MPS_techniques_for"
},
{
"path": "docs/source/examples_others.rst",
"chars": 204,
"preview": "Others\n======\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/Gedik_qudit\n notebooks/Boson_Bunching\n notebooks/quantum_k"
},
{
"path": "docs/source/examples_quantum_walk.rst",
"chars": 114,
"preview": "Quantum Walk\n============\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/Two-particle_bosonic-fermionic_quantum_walk\n"
},
{
"path": "docs/source/examples_standard_algo.rst",
"chars": 187,
"preview": "Standard Quantum Algorithms\n===========================\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/Walkthrough-cnot\n "
},
{
"path": "docs/source/examples_vqa.rst",
"chars": 238,
"preview": "Variational Quantum Algorithms\n==============================\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/Differential_e"
},
{
"path": "docs/source/getting_started.rst",
"chars": 3511,
"preview": "Getting started\n===============\n\nWhat is Perceval?\n^^^^^^^^^^^^^^^^^\n\nPerceval is a toolbox containing generic functions"
},
{
"path": "docs/source/index.rst",
"chars": 3534,
"preview": ":github_url: https://github.com/Quandela/Perceval\n\n.. figure:: _static/img/perceval.jpg\n :align: right\n :width: 250\n"
},
{
"path": "docs/source/legacy.rst",
"chars": 7812,
"preview": "Legacy\n======\n\nWhile, with its latest versions, Perceval tends to stabilise its public API, some changes may break exist"
},
{
"path": "docs/source/notebooks/2-mode_Grover_algorithm.ipynb",
"chars": 81169,
"preview": "{\n \"cells\": [\n {\n \"attachments\": {},\n \"cell_type\": \"markdown\",\n \"id\": \"3a271506\",\n \"metadata\": {},\n \"source\":"
},
{
"path": "docs/source/notebooks/Advanced_state_tutorial.ipynb",
"chars": 7154,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"6c48eed1a03dc991\",\n \"metadata\": {},\n \"source\": [\n \"# Repr"
},
{
"path": "docs/source/notebooks/BS-based_implementation.ipynb",
"chars": 93023,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"3d4fc10a\",\n \"metadata\": {},\n \"source\": [\n \"# Error-tolera"
},
{
"path": "docs/source/notebooks/Boson_Bunching.ipynb",
"chars": 81593,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"# Boson Bunching\\n\",\n \"\\n\",\n "
},
{
"path": "docs/source/notebooks/Boson_sampling.ipynb",
"chars": 5513093,
"preview": "{\r\n \"cells\": [\r\n {\r\n \"attachments\": {},\r\n \"cell_type\": \"markdown\",\r\n \"id\": \"5f842448\",\r\n \"metadata\": {},\r\n \"s"
},
{
"path": "docs/source/notebooks/Circuit_Tutorial.ipynb",
"chars": 113725,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"275dc7b20c7a685e\",\n \"metadata\": {},\n \"source\": [\n \"# Opti"
},
{
"path": "docs/source/notebooks/Computation_Tutorial.ipynb",
"chars": 23145,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"345cdcd4fc84356\",\n \"metadata\": {},\n \"source\": [\n \"# Local"
},
{
"path": "docs/source/notebooks/Density_matrix_Fock_space.ipynb",
"chars": 63963,
"preview": "{\r\n \"cells\": [\r\n {\r\n \"cell_type\": \"markdown\",\r\n \"metadata\": {\r\n \"collapsed\": false\r\n },\r\n \"source\": [\r\n \""
},
{
"path": "docs/source/notebooks/Differential_equation_resolution.ipynb",
"chars": 143493,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"c04e3ac9\",\n \"metadata\": {},\n \"source\": [\n \"# Differential"
},
{
"path": "docs/source/notebooks/Encoding_Tutorial.ipynb",
"chars": 44043,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"581eff927fa04130\",\n \"metadata\": {},\n \"source\": [\n \"# Logi"
},
{
"path": "docs/source/notebooks/Gedik_qudit.ipynb",
"chars": 59392,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"357ebaaf\",\n \"metadata\": {},\n \"source\": [\n \"# Gedik's algo"
},
{
"path": "docs/source/notebooks/Graph_States_Tutorial.ipynb",
"chars": 52858,
"preview": "{\n \"cells\": [\n {\n \"attachments\": {},\n \"cell_type\": \"markdown\",\n \"id\": \"cc7d159c\",\n \"metadata\": {},\n \"source\":"
},
{
"path": "docs/source/notebooks/LOv_rewriting_rules.ipynb",
"chars": 72502,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"dd3d8d19\",\n \"metadata\": {},\n \"source\": [\n \"# LOv rewritin"
},
{
"path": "docs/source/notebooks/MPS_techniques_for_boson_sampling.ipynb",
"chars": 95205,
"preview": "{\n \"cells\": [\n {\n \"attachments\": {},\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"# MPS techniq"
},
{
"path": "docs/source/notebooks/QLOQ_QUBO_tutorial.ipynb",
"chars": 76875,
"preview": "{\r\n \"cells\": [\r\n {\r\n \"cell_type\": \"markdown\",\r\n \"metadata\": {},\r\n \"source\": [\r\n \"# QLOQ (Qubit Logic on Qudits"
},
{
"path": "docs/source/notebooks/QUBO.ipynb",
"chars": 50113,
"preview": "{\n \"cells\": [\n {\n \"attachments\": {},\n \"cell_type\": \"markdown\",\n \"id\": \"349d0370\",\n \"metadata\": {},\n \"source\":"
},
{
"path": "docs/source/notebooks/Quantum_teleportation_feed_forward.ipynb",
"chars": 39228,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"7d428b7117a2a2fe\",\n \"metadata\": {},\n \"source\": [\n \"# Quan"
},
{
"path": "docs/source/notebooks/Reinforcement_learning.ipynb",
"chars": 394818,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"b1e0bbf3\",\n \"metadata\": {},\n \"source\": [\n \"# Reinforcemen"
},
{
"path": "docs/source/notebooks/Remote_Computation_Tutorial.ipynb",
"chars": 922495,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"345cdcd4fc84356\",\n \"metadata\": {},\n \"source\": [\n \"# Remot"
},
{
"path": "docs/source/notebooks/Shor_Implementation.ipynb",
"chars": 45516,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"c2f4fd6c\",\n \"metadata\": {},\n \"source\": [\n \"# Shor's algor"
},
{
"path": "docs/source/notebooks/Simulation_non-unitary_components.ipynb",
"chars": 46494,
"preview": "{\r\n \"cells\": [\r\n {\r\n \"cell_type\": \"markdown\",\r\n \"id\": \"6f3d5000\",\r\n \"metadata\": {},\r\n \"source\": [\r\n \"# Simul"
},
{
"path": "docs/source/notebooks/State_Tutorial.ipynb",
"chars": 12505,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"7f6effb781342585\",\n \"metadata\": {},\n \"source\": [\n \"# Quan"
},
{
"path": "docs/source/notebooks/Tomography_walkthrough.ipynb",
"chars": 457538,
"preview": "{\r\n \"cells\": [\r\n {\r\n \"cell_type\": \"markdown\",\r\n \"metadata\": {\r\n \"collapsed\": false\r\n },\r\n \"source\": [\r\n \""
},
{
"path": "docs/source/notebooks/Two-particle_bosonic-fermionic_quantum_walk.ipynb",
"chars": 236626,
"preview": "{\r\n \"cells\": [\r\n {\r\n \"cell_type\": \"markdown\",\r\n \"metadata\": {},\r\n \"source\": [\r\n \"# Two-particle bosonic-fermio"
},
{
"path": "docs/source/notebooks/VQA_Tutorial.ipynb",
"chars": 14293,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"1e8f0581\",\n \"metadata\": {},\n \"source\": [\n \"# Simple Varia"
},
{
"path": "docs/source/notebooks/Variational_Quantum_Eigensolver.ipynb",
"chars": 194924,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"39710952\",\n \"metadata\": {},\n \"source\": [\n \"# Variational "
},
{
"path": "docs/source/notebooks/Walkthrough-cnot.ipynb",
"chars": 82128,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"id\": \"29990c15\",\n \"metadata\": {},\n \"source\": [\n \"# CHSH experim"
},
{
"path": "docs/source/notebooks/quantum_kernel_methods.ipynb",
"chars": 317022,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"# Quantum kernel methods using line"
},
{
"path": "docs/source/notebooks/requirements.txt",
"chars": 36,
"preview": "jupyter\nnbconvert\nscikit-learn>=1.4\n"
},
{
"path": "docs/source/reference/algorithm/analyzer.rst",
"chars": 1415,
"preview": "Analyzer\n^^^^^^^^\n\nThe ``Analyzer`` algorithm aims at testing a processor, computing a probability table between input s"
},
{
"path": "docs/source/reference/algorithm/index.rst",
"chars": 2010,
"preview": "algorithm\n^^^^^^^^^\n\nThe :code:`perceval.algorithm` package contains the code of several simple and generic **quantum al"
},
{
"path": "docs/source/reference/algorithm/sampler.rst",
"chars": 3552,
"preview": "Sampler\n^^^^^^^\n\nThe :code:`Sampler` is the simplest algorithm provided, yet an important gateway to using processors.\n\n"
},
{
"path": "docs/source/reference/algorithm/tomography.rst",
"chars": 753,
"preview": "Tomography\n^^^^^^^^^^\n\nThe tomography module in Perceval provides tools for performing quantum tomography experiments.\n\n"
},
{
"path": "docs/source/reference/backends/clifford2017.rst",
"chars": 1166,
"preview": "Clifford2017Backend\n^^^^^^^^^^^^^^^^^^^\n\nThe :code:`Clifford2017Backend` is a sampling backend that is able to compute r"
},
{
"path": "docs/source/reference/backends/index.rst",
"chars": 1327,
"preview": "backends\n^^^^^^^^\n\nBackends are the lowest level of computation of perceval.\nThey all aim at providing ways of simulatin"
},
{
"path": "docs/source/reference/backends/mps.rst",
"chars": 2072,
"preview": "MPSBackend\n^^^^^^^^^^\n\nThe :code:`MPSBackend` is a strong simulation backend that can compute the whole output distribut"
},
{
"path": "docs/source/reference/backends/naive.rst",
"chars": 1209,
"preview": "NaiveBackend\n^^^^^^^^^^^^\n\nThe :code:`NaiveBackend` is a strong simulation backend that can compute a single output prob"
},
{
"path": "docs/source/reference/backends/naive_approx.rst",
"chars": 2079,
"preview": "NaiveApproxBackend\n^^^^^^^^^^^^^^^^^^\n\nLike the :ref:`NaiveBackend`, the :code:`NaiveApproxBackend` is a strong simulati"
},
{
"path": "docs/source/reference/backends/slap.rst",
"chars": 1370,
"preview": "SLAPBackend\n^^^^^^^^^^^\n\nThe :code:`SLAPBackend` (for Simulator of LAttice of Polynomials) is a strong simulation backen"
},
{
"path": "docs/source/reference/backends/slos.rst",
"chars": 1497,
"preview": "SLOSBackend\n^^^^^^^^^^^\n\nThe :code:`SLOSBackend` (for Strong Linear Optical Simulation) is a strong simulation backend t"
},
{
"path": "docs/source/reference/components/catalog.rst",
"chars": 1220,
"preview": "Catalog\n=======\n\nThe concept of the *catalog* is to provide the user a set of basic of qbit or photonic gate or circuit."
},
{
"path": "docs/source/reference/components/circuit.rst",
"chars": 3413,
"preview": "Circuit\n=======\n\nThe basic usage and definition of Circuit can be found in :ref:`the tutorial<Optical Circuits>`.\n\nAcces"
},
{
"path": "docs/source/reference/components/detector.rst",
"chars": 1375,
"preview": "Detector\n========\n\nDetectors are components that aim at simulating real hardware detectors, or perfect detectors.\n\nThey "
},
{
"path": "docs/source/reference/components/experiment.rst",
"chars": 1028,
"preview": "Experiment\n^^^^^^^^^^\n\nExperiments behave the same way as Processors and RemoteProcessors,\nexcept that they don't know h"
},
{
"path": "docs/source/reference/components/feed_forward_configurator.rst",
"chars": 2369,
"preview": "Feed-forward Configurators\n==========================\n\nConfigurators are the way to perform a feed-forward computation.\n"
},
{
"path": "docs/source/reference/components/generic_interferometer.rst",
"chars": 912,
"preview": "Generic Interferometer\n^^^^^^^^^^^^^^^^^^^^^^\n\nGenericInterferometer usage example\n===================================\n\n"
},
{
"path": "docs/source/reference/components/index.rst",
"chars": 235,
"preview": "components\n^^^^^^^^^^\n\n.. toctree::\n :maxdepth: 2\n\n unitary_components\n circuit\n generic_interferometer\n exper"
},
{
"path": "docs/source/reference/components/non_unitary_components.rst",
"chars": 916,
"preview": "Non-unitary Components\n^^^^^^^^^^^^^^^^^^^^^^\n\nSupported non-unitary components\n================================\n\n.. lis"
},
{
"path": "docs/source/reference/components/port.rst",
"chars": 662,
"preview": "Ports and data encoding\n^^^^^^^^^^^^^^^^^^^^^^^\n\nPorts are a mean to describe data encoding at the input and the output "
},
{
"path": "docs/source/reference/components/processor.rst",
"chars": 8698,
"preview": "Processor\n=========\n\nProcessor is a mean to run a quantum algorithm locally (i.e. on the user's computer) using a simula"
},
{
"path": "docs/source/reference/components/source.rst",
"chars": 604,
"preview": "Source\n======\n\n>>> import perceval as pcvl\n>>> source = pcvl.Source(emission_probability=0.3, multiphoton_component=0.05"
},
{
"path": "docs/source/reference/components/unitary_components.rst",
"chars": 6727,
"preview": "Unitary Components\n^^^^^^^^^^^^^^^^^^\n\nOverview\n========\n\n.. list-table::\n :header-rows: 1\n :width: 100%\n\n * - Nam"
},
{
"path": "docs/source/reference/error_mitigation.rst",
"chars": 330,
"preview": "error_mitigation\n================\n\nThe error_mitigation package provides tools and algorithms for mitigating errors in q"
},
{
"path": "docs/source/reference/exqalibur/circuit_optimizer.rst",
"chars": 236,
"preview": "CircuitOptimizer\n================\n\nThis class allows for low level calls which are wrapped in a Python class having the "
},
{
"path": "docs/source/reference/exqalibur/clifford2017.rst",
"chars": 78,
"preview": "Clifford2017\n============\n\n.. autoclass:: exqalibur.Clifford2017\n :members:\n"
},
{
"path": "docs/source/reference/exqalibur/config.rst",
"chars": 283,
"preview": "Config\n======\n\n.. autoclass:: exqalibur.Config\n.. autoattribute:: exqalibur.Config.compute_max_thread_count\n.. autoattri"
},
{
"path": "docs/source/reference/exqalibur/fockstate.rst",
"chars": 340,
"preview": "Fock state classes\n^^^^^^^^^^^^^^^^^^\n\nFockState\n---------\n\n.. autoclass:: exqalibur.FockState\n :members:\n\nNoisyFockSt"
},
{
"path": "docs/source/reference/exqalibur/fs_utils.rst",
"chars": 124,
"preview": "FSMask\n======\n\n.. autoclass:: exqalibur.FSMask\n :members:\n\nFSArray\n=======\n\n.. autoclass:: exqalibur.FSArray\n :membe"
},
{
"path": "docs/source/reference/exqalibur/index.rst",
"chars": 297,
"preview": "exqalibur\n^^^^^^^^^\n\n**exqalibur** is a C++ toolbox of highly optimised algorithms. **Perceval** relies heavily on it.\n\n"
},
{
"path": "docs/source/reference/exqalibur/permanent.rst",
"chars": 326,
"preview": "Permanent\n=========\n\nExact permanent computation\n---------------------------\n\n.. autofunction:: exqalibur.permanent_fl\n\n"
},
{
"path": "docs/source/reference/exqalibur/postselect.rst",
"chars": 257,
"preview": "PostSelect\n==========\n\n.. autoclass:: perceval.utils.postselect.PostSelect\n :members:\n :special-members: __call__\n\n."
},
{
"path": "docs/source/reference/exqalibur/slap.rst",
"chars": 291,
"preview": "SLAP\n====\n\n`SLAP` (Simulator of LAttice of Polynomials) is a strong simulation back-end. The exqalibur C++ class is high"
},
{
"path": "docs/source/reference/exqalibur/slos.rst",
"chars": 107,
"preview": "all_prob_normalize_output\n=========================\n\n.. autofunction:: exqalibur.all_prob_normalize_output\n"
},
{
"path": "docs/source/reference/exqalibur/source.rst",
"chars": 142,
"preview": "Source\n======\n\n.. autoclass:: exqalibur.Source\n :members:\n\nSourceSampler\n=============\n\n.. autoclass:: exqalibur.Sourc"
},
{
"path": "docs/source/reference/exqalibur/state_data_structure.rst",
"chars": 218,
"preview": "BSDistribution\n==============\n\n.. autoclass:: exqalibur.BSDistribution\n :members:\n\nBSCount\n=======\n\n.. autoclass:: exq"
},
{
"path": "docs/source/reference/exqalibur/statevector.rst",
"chars": 2417,
"preview": "StateVector\n===========\n\nThe ``StateVector`` class is the mean to create superposed pure states in the Fock space.\n\nStat"
},
{
"path": "docs/source/reference/providers.rst",
"chars": 4052,
"preview": "providers\n=========\n\nQuandela\n--------\n\nQuandela is Perceval default Cloud provider. If no session is created, Quandela "
},
{
"path": "docs/source/reference/rendering/display_config.rst",
"chars": 516,
"preview": "DisplayConfig\n=============\n\nThis class allows you to choose a display skin for pdisplay and save the chosen skin across"
},
{
"path": "docs/source/reference/rendering/index.rst",
"chars": 73,
"preview": "rendering\n^^^^^^^^^\n\n.. toctree::\n pdisplay\n skins\n display_config\n"
},
{
"path": "docs/source/reference/rendering/pdisplay.rst",
"chars": 14033,
"preview": "pdisplay\n========\n\nAlso known as \"Perceval pretty display\", is a generic function designed to display a lot of different"
},
{
"path": "docs/source/reference/rendering/skins.rst",
"chars": 2047,
"preview": "Circuit rendering skins\n^^^^^^^^^^^^^^^^^^^^^^^\n\nWhen rendering a :ref:`Circuit`, an :ref:`Experiment` or a :ref:`Proces"
},
{
"path": "docs/source/reference/runtime/index.rst",
"chars": 115,
"preview": "runtime\n^^^^^^^\n\n.. toctree::\n remote_processor\n remote_config\n job\n job_status\n job_group\n rpchandler\n"
},
{
"path": "docs/source/reference/runtime/job.rst",
"chars": 2382,
"preview": "Job\n^^^\n\nJob is class responsible for the computation and retrieval of a task's results. It hides the `local` vs `remote"
},
{
"path": "docs/source/reference/runtime/job_group.rst",
"chars": 3965,
"preview": "JobGroup\n========\n\nThe :code:`JobGroup` class is designed to help manage jobs client-side by storing them in named group"
},
{
"path": "docs/source/reference/runtime/job_status.rst",
"chars": 488,
"preview": "JobStatus\n^^^^^^^^^\n\nA :ref:`Job` object contains a lot of metadata on top of the computation results a user wants to ge"
},
{
"path": "docs/source/reference/runtime/remote_config.rst",
"chars": 199,
"preview": "RemoteConfig\n^^^^^^^^^^^^\n\n.. note:: We recommend you save your token only on a personal computer, not on shared/public "
},
{
"path": "docs/source/reference/runtime/remote_processor.rst",
"chars": 3802,
"preview": "RemoteProcessor\n^^^^^^^^^^^^^^^\n\n:code:`RemoteProcessor` class is the entry point for sending a computation on a remote "
},
{
"path": "docs/source/reference/runtime/rpchandler.rst",
"chars": 323,
"preview": "RPCHandler\n^^^^^^^^^^\n\nA :code:`RPCHanlder` (RPC stands for `Remote Procedure Call`) is responsible for all the requests"
},
{
"path": "docs/source/reference/serialization.rst",
"chars": 3121,
"preview": "serialization\n^^^^^^^^^^^^^\n\nPerceval provides a generic way to serialize most objects into strings that can be deserial"
},
{
"path": "docs/source/reference/simulators/ff_simulator.rst",
"chars": 982,
"preview": "FFSimulator\n===========\n\nThe :code:`FFSimulator` is a simulator dedicated to simulate feed-forward experiments.\n\nLike th"
},
{
"path": "docs/source/reference/simulators/index.rst",
"chars": 125,
"preview": "simulators\n^^^^^^^^^^\n\n.. toctree::\n simulator\n simulator_factory\n noisy_sampling_simulator\n ff_simulator\n ste"
},
{
"path": "docs/source/reference/simulators/noisy_sampling_simulator.rst",
"chars": 1801,
"preview": "NoisySamplingSimulator\n======================\n\nThe :code:`NoisySamplingSimulator` is a special simulator dedicated to sa"
},
{
"path": "docs/source/reference/simulators/simulator.rst",
"chars": 5170,
"preview": "Simulator\n=========\n\nThe :code:`Simulator` class is a mid-level class that can be used to compute\noutput probabilities o"
},
{
"path": "docs/source/reference/simulators/simulator_factory.rst",
"chars": 2524,
"preview": "SimulatorFactory\n================\n\nThis class exposes a single :code:`build` static method that can be used to create a "
},
{
"path": "docs/source/reference/simulators/stepper.rst",
"chars": 1680,
"preview": "Stepper Simulator\n=================\n\nThe :code:`Stepper` is a special simulator that simulates the evolution of a :code:"
},
{
"path": "docs/source/reference/utils/conversion.rst",
"chars": 915,
"preview": "conversion\n^^^^^^^^^^\n\nPerceval provides helper methods to convert the three types of results of the :ref:`Sampler`\n(nam"
},
{
"path": "docs/source/reference/utils/density_matrix.rst",
"chars": 1484,
"preview": "DensityMatrix\n=============\n\nAn other way of representing mixed states is through the Density Matrices formalism. You ca"
},
{
"path": "docs/source/reference/utils/dist_metrics.rst",
"chars": 489,
"preview": "metrics\n^^^^^^^\n\n>>> import perceval as pcvl\n>>> dist_a = pcvl.BSDistribution({pcvl.BasicState([1, 0]): 0.4, pcvl.BasicS"
},
{
"path": "docs/source/reference/utils/distinct_permutations.rst",
"chars": 547,
"preview": "distinct permutations\n^^^^^^^^^^^^^^^^^^^^^\n\nPerceval has a built-in method to construct efficiently the distinct permut"
},
{
"path": "docs/source/reference/utils/expression.rst",
"chars": 763,
"preview": "Expression\n==========\n\nThis is a derived class from :code:`Parameter` that can hold mathematical expressions.\nAn :code:`"
},
{
"path": "docs/source/reference/utils/index.rst",
"chars": 286,
"preview": "utils\n^^^^^\n\n.. toctree::\n matrix\n parameter\n states\n noise_model\n expression\n conversion\n logical_state\n "
},
{
"path": "docs/source/reference/utils/logging.rst",
"chars": 6051,
"preview": "utils.logging\n=============\n\nTo log with Perceval you can either use a built-in Perceval logger or the python one. By de"
},
{
"path": "docs/source/reference/utils/logical_state.rst",
"chars": 1576,
"preview": "Logical State\n=============\n\nA :code:`LogicalState` represents a pure qubit state. It is a list of 0s and 1s.\n\nTheir mai"
},
{
"path": "docs/source/reference/utils/matrix.rst",
"chars": 721,
"preview": "Matrix\n======\n\nThis class is used to represent both numeric and symbolic complex matrices.\nEvery matrix in perceval is a"
},
{
"path": "docs/source/reference/utils/noise_model.rst",
"chars": 252,
"preview": "Noise Model\n===========\n\n>>> import perceval as pcvl\n>>> noise_model = pcvl.NoiseModel(brightness=0.3, g2=0.05)\n>>> proc"
},
{
"path": "docs/source/reference/utils/parameter.rst",
"chars": 625,
"preview": "Parameter\n=========\n\nThis class holds parameter values that can be used in circuits and in backends supporting symbolic "
},
{
"path": "docs/source/reference/utils/persistent_data.rst",
"chars": 907,
"preview": "PersistentData\n==============\n\n:code:`PersistentData` is a class that allows to save and store data across perceval laun"
},
{
"path": "docs/source/reference/utils/polarization.rst",
"chars": 3015,
"preview": "Polarization\n============\n\nPolarization encoding is stored in :ref:`AnnotatedFockState` objects as a special ``P`` annot"
},
{
"path": "docs/source/reference/utils/random_seed.rst",
"chars": 723,
"preview": "random_seed\n===========\n\nTo achieve a reproducible result, the :code:`pcvl.random_seed()` function can be used before a "
},
{
"path": "docs/source/reference/utils/stategenerator.rst",
"chars": 506,
"preview": "State Generator\n===============\n\nThis class provides a way to generate usual StateVectors with a given encoding.\n\n>>> fr"
},
{
"path": "docs/source/reference/utils/states.rst",
"chars": 5130,
"preview": "States\n======\n\nStates hold the quantum data. Perceval introduces a formalism to represent all kinds of quantum states.\n\n"
},
{
"path": "docs/source/reference/utils_algorithms/circuit_optimizer.rst",
"chars": 149,
"preview": "Circuit Optimizer\n=================\n\n.. autoclass:: perceval.utils.algorithms.circuit_optimizer.CircuitOptimizer\n :mem"
},
{
"path": "docs/source/reference/utils_algorithms/index.rst",
"chars": 81,
"preview": "utils.algorithms\n^^^^^^^^^^^^^^^^\n\n.. toctree::\n circuit_optimizer\n simplify\n"
},
{
"path": "docs/source/reference/utils_algorithms/simplify.rst",
"chars": 1277,
"preview": "simplify\n========\n\nCircuit simplification\n^^^^^^^^^^^^^^^^^^^^^^\n\nSeveral strategies to simplify a circuit exist. Percev"
},
{
"path": "docs/source/references.bib",
"chars": 72702,
"preview": "@article{clement2022lov,\r\n\ttitle = {LOv-Calculus: A Graphical Language for Linear Optical Quantum Circuits},\r\n\tauthor = "
},
{
"path": "docs/source/tutorial_advanced.rst",
"chars": 293,
"preview": "Advanced tutorials\n^^^^^^^^^^^^^^^^^^\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/Quantum_teleportation_feed_forward\n "
},
{
"path": "docs/source/tutorial_beginner.rst",
"chars": 214,
"preview": "Beginner tutorials\n^^^^^^^^^^^^^^^^^^\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/State_Tutorial\n notebooks/Circuit_Tu"
},
{
"path": "docs/source/tutorial_expert.rst",
"chars": 172,
"preview": "Expert tutorials\n^^^^^^^^^^^^^^^^\n\n.. toctree::\n :maxdepth: 2\n\n notebooks/Tomography_walkthrough\n notebooks/QLOQ_Q"
},
{
"path": "perceval/__init__.py",
"chars": 3239,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/__init__.py",
"chars": 1738,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/abstract_algorithm.py",
"chars": 2776,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/analyzer.py",
"chars": 9460,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/sampler.py",
"chars": 15276,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/tomography/__init__.py",
"chars": 1805,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/tomography/abstract_process_tomography.py",
"chars": 5524,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/tomography/tomography.py",
"chars": 11936,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/tomography/tomography_mle.py",
"chars": 18145,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/algorithm/tomography/tomography_utils.py",
"chars": 12473,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/__init__.py",
"chars": 2651,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/_abstract_backends.py",
"chars": 10073,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/_clifford2017.py",
"chars": 2594,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/_mps.py",
"chars": 16537,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/_naive.py",
"chars": 2982,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/_naive_approx.py",
"chars": 3249,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/_slap.py",
"chars": 7560,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/backends/_slos.py",
"chars": 9703,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/__init__.py",
"chars": 2846,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/_decompose_perms.py",
"chars": 2131,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/_mode_connector.py",
"chars": 12192,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/_pauli.py",
"chars": 6086,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/abstract_component.py",
"chars": 8364,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/abstract_processor.py",
"chars": 13419,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/compiled_circuit.py",
"chars": 3590,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/component_catalog.py",
"chars": 4769,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/__init__.py",
"chars": 2840,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/_helpers/__init__.py",
"chars": 1690,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/_helpers/entanglement_qloq.py",
"chars": 4662,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/_helpers/rotations_qloq.py",
"chars": 5969,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/controlled_rotation_gates.py",
"chars": 5076,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/gates_1qubit.py",
"chars": 5933,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/generic_2mode.py",
"chars": 3012,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/heralded_cnot.py",
"chars": 3148,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/heralded_cz.py",
"chars": 3898,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/klm_cnot.py",
"chars": 3803,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/mzi.py",
"chars": 4661,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/postprocessed_ccz.py",
"chars": 3313,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/postprocessed_cnot.py",
"chars": 3080,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/postprocessed_cz.py",
"chars": 3242,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/qloq_ansatz.py",
"chars": 9092,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/core_catalog/toffoli.py",
"chars": 3417,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/detector.py",
"chars": 13697,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/experiment.py",
"chars": 39743,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/feed_forward_configurator.py",
"chars": 12172,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/generic_interferometer.py",
"chars": 12230,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/linear_circuit.py",
"chars": 36193,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/non_unitary_components.py",
"chars": 5961,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "perceval/components/port.py",
"chars": 6739,
"preview": "# MIT License\n#\n# Copyright (c) 2022 Quandela\n#\n# Permission is hereby granted, free of charge, to any person obtaining "
}
]
// ... and 218 more files (download for full content)
About this extraction
This page contains the full source code of the Quandela/Perceval GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 418 files (10.9 MB), approximately 2.9M tokens, and a symbol index with 2651 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.