From 8d97e98a4458e682d99762981c6038aab6113f72 Mon Sep 17 00:00:00 2001 From: Jintao YU Date: Sat, 5 Feb 2022 02:35:31 +0800 Subject: [PATCH] Add circuit diagrams to source code (#7350) * Add circuit diagrams to test_hoare_opt.py * Add circuit diagram to equivalence_library.py * Add a TODO in equivalence_library.py * Add circuit diagram to echo_rzx_weyl_decomposition * Add circuit diagram to merge_adjacent_barriers.py * Add circuit diagram to test/python/circuit/library * Add circuit diagram to test/python/circuit * Add circuit diagram to test/python/compiler * Add circuit diagram to test/python/dagcircuit * Add circuit diagram to test/python * Format source code with black * Chang block comment from string to line annotation * Add circuit diagram to standard_gates * Add parsed-literal before circuit diagram * fix a lint problem * Update circuit diagram in test * Fix a lint problem * Add blank lines before and after parsed-literal Co-authored-by: Luciano Bello --- .../algorithms/amplitude_estimators/estimation_problem.py | 4 ++-- test/python/algorithms/test_skip_qobj_validation.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qiskit/algorithms/amplitude_estimators/estimation_problem.py b/qiskit/algorithms/amplitude_estimators/estimation_problem.py index 056fc83687b4..be563614809b 100644 --- a/qiskit/algorithms/amplitude_estimators/estimation_problem.py +++ b/qiskit/algorithms/amplitude_estimators/estimation_problem.py @@ -221,7 +221,7 @@ def _rescale_amplitudes(circuit: QuantumCircuit, scaling_factor: float) -> Quant For example, for a scaling factor of 0.25 this turns this circuit - .. code-block:: + .. parsed-literal:: ┌───┐ state_0: ─────┤ H ├─────────■──── @@ -231,7 +231,7 @@ def _rescale_amplitudes(circuit: QuantumCircuit, scaling_factor: float) -> Quant into - .. code-block:: + .. parsed-literal:: ┌───┐ state_0: ─────┤ H ├─────────■──── diff --git a/test/python/algorithms/test_skip_qobj_validation.py b/test/python/algorithms/test_skip_qobj_validation.py index 7c3195e97e9f..dc7b7a0e5c19 100644 --- a/test/python/algorithms/test_skip_qobj_validation.py +++ b/test/python/algorithms/test_skip_qobj_validation.py @@ -40,6 +40,13 @@ def setUp(self): super().setUp() self.random_seed = 10598 + # ┌───┐ ░ ┌─┐ ░ + # q0_0: ┤ H ├──■───░─┤M├─░──── + # └───┘┌─┴─┐ ░ └╥┘ ░ ┌─┐ + # q0_1: ─────┤ X ├─░──╫──░─┤M├ + # └───┘ ░ ║ ░ └╥┘ + # c0: 2/══════════════╩═════╩═ + # 0 1 qr = QuantumRegister(2) cr = ClassicalRegister(2) qc = QuantumCircuit(qr, cr)