{"payload":{"allShortcutsEnabled":false,"fileTree":{"qiskit/circuit/library/n_local":{"items":[{"name":"__init__.py","path":"qiskit/circuit/library/n_local/__init__.py","contentType":"file"},{"name":"efficient_su2.py","path":"qiskit/circuit/library/n_local/efficient_su2.py","contentType":"file"},{"name":"evolved_operator_ansatz.py","path":"qiskit/circuit/library/n_local/evolved_operator_ansatz.py","contentType":"file"},{"name":"excitation_preserving.py","path":"qiskit/circuit/library/n_local/excitation_preserving.py","contentType":"file"},{"name":"n_local.py","path":"qiskit/circuit/library/n_local/n_local.py","contentType":"file"},{"name":"pauli_two_design.py","path":"qiskit/circuit/library/n_local/pauli_two_design.py","contentType":"file"},{"name":"qaoa_ansatz.py","path":"qiskit/circuit/library/n_local/qaoa_ansatz.py","contentType":"file"},{"name":"real_amplitudes.py","path":"qiskit/circuit/library/n_local/real_amplitudes.py","contentType":"file"},{"name":"two_local.py","path":"qiskit/circuit/library/n_local/two_local.py","contentType":"file"}],"totalCount":9},"qiskit/circuit/library":{"items":[{"name":"arithmetic","path":"qiskit/circuit/library/arithmetic","contentType":"directory"},{"name":"basis_change","path":"qiskit/circuit/library/basis_change","contentType":"directory"},{"name":"boolean_logic","path":"qiskit/circuit/library/boolean_logic","contentType":"directory"},{"name":"data_preparation","path":"qiskit/circuit/library/data_preparation","contentType":"directory"},{"name":"generalized_gates","path":"qiskit/circuit/library/generalized_gates","contentType":"directory"},{"name":"n_local","path":"qiskit/circuit/library/n_local","contentType":"directory"},{"name":"standard_gates","path":"qiskit/circuit/library/standard_gates","contentType":"directory"},{"name":"templates","path":"qiskit/circuit/library/templates","contentType":"directory"},{"name":"__init__.py","path":"qiskit/circuit/library/__init__.py","contentType":"file"},{"name":"blueprintcircuit.py","path":"qiskit/circuit/library/blueprintcircuit.py","contentType":"file"},{"name":"fourier_checking.py","path":"qiskit/circuit/library/fourier_checking.py","contentType":"file"},{"name":"graph_state.py","path":"qiskit/circuit/library/graph_state.py","contentType":"file"},{"name":"grover_operator.py","path":"qiskit/circuit/library/grover_operator.py","contentType":"file"},{"name":"hamiltonian_gate.py","path":"qiskit/circuit/library/hamiltonian_gate.py","contentType":"file"},{"name":"hidden_linear_function.py","path":"qiskit/circuit/library/hidden_linear_function.py","contentType":"file"},{"name":"iqp.py","path":"qiskit/circuit/library/iqp.py","contentType":"file"},{"name":"overlap.py","path":"qiskit/circuit/library/overlap.py","contentType":"file"},{"name":"pauli_evolution.py","path":"qiskit/circuit/library/pauli_evolution.py","contentType":"file"},{"name":"phase_estimation.py","path":"qiskit/circuit/library/phase_estimation.py","contentType":"file"},{"name":"phase_oracle.py","path":"qiskit/circuit/library/phase_oracle.py","contentType":"file"},{"name":"quantum_volume.py","path":"qiskit/circuit/library/quantum_volume.py","contentType":"file"}],"totalCount":21},"qiskit/circuit":{"items":[{"name":"classical","path":"qiskit/circuit/classical","contentType":"directory"},{"name":"classicalfunction","path":"qiskit/circuit/classicalfunction","contentType":"directory"},{"name":"controlflow","path":"qiskit/circuit/controlflow","contentType":"directory"},{"name":"library","path":"qiskit/circuit/library","contentType":"directory"},{"name":"random","path":"qiskit/circuit/random","contentType":"directory"},{"name":"tools","path":"qiskit/circuit/tools","contentType":"directory"},{"name":"__init__.py","path":"qiskit/circuit/__init__.py","contentType":"file"},{"name":"_classical_resource_map.py","path":"qiskit/circuit/_classical_resource_map.py","contentType":"file"},{"name":"_standard_gates_commutations.py","path":"qiskit/circuit/_standard_gates_commutations.py","contentType":"file"},{"name":"_utils.py","path":"qiskit/circuit/_utils.py","contentType":"file"},{"name":"add_control.py","path":"qiskit/circuit/add_control.py","contentType":"file"},{"name":"annotated_operation.py","path":"qiskit/circuit/annotated_operation.py","contentType":"file"},{"name":"barrier.py","path":"qiskit/circuit/barrier.py","contentType":"file"},{"name":"bit.py","path":"qiskit/circuit/bit.py","contentType":"file"},{"name":"classicalregister.py","path":"qiskit/circuit/classicalregister.py","contentType":"file"},{"name":"commutation_checker.py","path":"qiskit/circuit/commutation_checker.py","contentType":"file"},{"name":"commutation_library.py","path":"qiskit/circuit/commutation_library.py","contentType":"file"},{"name":"controlledgate.py","path":"qiskit/circuit/controlledgate.py","contentType":"file"},{"name":"delay.py","path":"qiskit/circuit/delay.py","contentType":"file"},{"name":"duration.py","path":"qiskit/circuit/duration.py","contentType":"file"},{"name":"equivalence.py","path":"qiskit/circuit/equivalence.py","contentType":"file"},{"name":"equivalence_library.py","path":"qiskit/circuit/equivalence_library.py","contentType":"file"},{"name":"exceptions.py","path":"qiskit/circuit/exceptions.py","contentType":"file"},{"name":"gate.py","path":"qiskit/circuit/gate.py","contentType":"file"},{"name":"instruction.py","path":"qiskit/circuit/instruction.py","contentType":"file"},{"name":"instructionset.py","path":"qiskit/circuit/instructionset.py","contentType":"file"},{"name":"measure.py","path":"qiskit/circuit/measure.py","contentType":"file"},{"name":"operation.py","path":"qiskit/circuit/operation.py","contentType":"file"},{"name":"parameter.py","path":"qiskit/circuit/parameter.py","contentType":"file"},{"name":"parameterexpression.py","path":"qiskit/circuit/parameterexpression.py","contentType":"file"},{"name":"parametertable.py","path":"qiskit/circuit/parametertable.py","contentType":"file"},{"name":"parametervector.py","path":"qiskit/circuit/parametervector.py","contentType":"file"},{"name":"quantumcircuit.py","path":"qiskit/circuit/quantumcircuit.py","contentType":"file"},{"name":"quantumcircuitdata.py","path":"qiskit/circuit/quantumcircuitdata.py","contentType":"file"},{"name":"quantumregister.py","path":"qiskit/circuit/quantumregister.py","contentType":"file"},{"name":"register.py","path":"qiskit/circuit/register.py","contentType":"file"},{"name":"reset.py","path":"qiskit/circuit/reset.py","contentType":"file"},{"name":"singleton.py","path":"qiskit/circuit/singleton.py","contentType":"file"},{"name":"store.py","path":"qiskit/circuit/store.py","contentType":"file"}],"totalCount":39},"qiskit":{"items":[{"name":"assembler","path":"qiskit/assembler","contentType":"directory"},{"name":"circuit","path":"qiskit/circuit","contentType":"directory"},{"name":"compiler","path":"qiskit/compiler","contentType":"directory"},{"name":"converters","path":"qiskit/converters","contentType":"directory"},{"name":"dagcircuit","path":"qiskit/dagcircuit","contentType":"directory"},{"name":"passmanager","path":"qiskit/passmanager","contentType":"directory"},{"name":"primitives","path":"qiskit/primitives","contentType":"directory"},{"name":"providers","path":"qiskit/providers","contentType":"directory"},{"name":"pulse","path":"qiskit/pulse","contentType":"directory"},{"name":"qasm","path":"qiskit/qasm","contentType":"directory"},{"name":"qasm2","path":"qiskit/qasm2","contentType":"directory"},{"name":"qasm3","path":"qiskit/qasm3","contentType":"directory"},{"name":"qobj","path":"qiskit/qobj","contentType":"directory"},{"name":"qpy","path":"qiskit/qpy","contentType":"directory"},{"name":"quantum_info","path":"qiskit/quantum_info","contentType":"directory"},{"name":"result","path":"qiskit/result","contentType":"directory"},{"name":"scheduler","path":"qiskit/scheduler","contentType":"directory"},{"name":"synthesis","path":"qiskit/synthesis","contentType":"directory"},{"name":"transpiler","path":"qiskit/transpiler","contentType":"directory"},{"name":"utils","path":"qiskit/utils","contentType":"directory"},{"name":"visualization","path":"qiskit/visualization","contentType":"directory"},{"name":"VERSION.txt","path":"qiskit/VERSION.txt","contentType":"file"},{"name":"__init__.py","path":"qiskit/__init__.py","contentType":"file"},{"name":"exceptions.py","path":"qiskit/exceptions.py","contentType":"file"},{"name":"user_config.py","path":"qiskit/user_config.py","contentType":"file"},{"name":"version.py","path":"qiskit/version.py","contentType":"file"}],"totalCount":26},"":{"items":[{"name":".azure","path":".azure","contentType":"directory"},{"name":".binder","path":".binder","contentType":"directory"},{"name":".cargo","path":".cargo","contentType":"directory"},{"name":".github","path":".github","contentType":"directory"},{"name":"crates","path":"crates","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"examples","path":"examples","contentType":"directory"},{"name":"qiskit","path":"qiskit","contentType":"directory"},{"name":"releasenotes","path":"releasenotes","contentType":"directory"},{"name":"test","path":"test","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".editorconfig","path":".editorconfig","contentType":"file"},{"name":".git-blame-ignore-revs","path":".git-blame-ignore-revs","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".local-spellings","path":".local-spellings","contentType":"file"},{"name":".mailmap","path":".mailmap","contentType":"file"},{"name":".mergify.yml","path":".mergify.yml","contentType":"file"},{"name":".stestr.conf","path":".stestr.conf","contentType":"file"},{"name":"CITATION.bib","path":"CITATION.bib","contentType":"file"},{"name":"CODE_OF_CONDUCT.md","path":"CODE_OF_CONDUCT.md","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"file"},{"name":"Cargo.lock","path":"Cargo.lock","contentType":"file"},{"name":"Cargo.toml","path":"Cargo.toml","contentType":"file"},{"name":"DEPRECATION.md","path":"DEPRECATION.md","contentType":"file"},{"name":"LICENSE.txt","path":"LICENSE.txt","contentType":"file"},{"name":"MAINTAINING.md","path":"MAINTAINING.md","contentType":"file"},{"name":"MANIFEST.in","path":"MANIFEST.in","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"SECURITY.md","path":"SECURITY.md","contentType":"file"},{"name":"asv.conf.json","path":"asv.conf.json","contentType":"file"},{"name":"azure-pipelines.yml","path":"azure-pipelines.yml","contentType":"file"},{"name":"constraints.txt","path":"constraints.txt","contentType":"file"},{"name":"pyproject.toml","path":"pyproject.toml","contentType":"file"},{"name":"qiskit_bot.yaml","path":"qiskit_bot.yaml","contentType":"file"},{"name":"requirements-dev.txt","path":"requirements-dev.txt","contentType":"file"},{"name":"requirements-optional.txt","path":"requirements-optional.txt","contentType":"file"},{"name":"requirements.txt","path":"requirements.txt","contentType":"file"},{"name":"rust-toolchain.toml","path":"rust-toolchain.toml","contentType":"file"},{"name":"setup.py","path":"setup.py","contentType":"file"},{"name":"tox.ini","path":"tox.ini","contentType":"file"}],"totalCount":41}},"fileTreeProcessingTime":13.60188,"foldersToFetch":[],"repo":{"id":83821669,"defaultBranch":"main","name":"qiskit","ownerLogin":"Qiskit","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2017-03-03T17:02:42.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/30696987?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"main","listCacheKey":"v0:1710785011.0","canEdit":false,"refType":"branch","currentOid":"43381ae1b159c01b55159d2dc1e8a65970b72746"},"path":"qiskit/circuit/library/n_local/two_local.py","currentUser":null,"blob":{"rawLines":["# This code is part of Qiskit.","#","# (C) Copyright IBM 2017, 2020.","#","# This code is licensed under the Apache License, Version 2.0. You may","# obtain a copy of this license in the LICENSE.txt file in the root directory","# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.","#","# Any modifications or derivative works of this code must retain this","# copyright notice, and modified files need to carry a notice indicating","# that they have been altered from the originals.","","\"\"\"The two-local gate circuit.\"\"\"","","from __future__ import annotations","import typing","from collections.abc import Callable, Sequence","","from qiskit.circuit.quantumcircuit import QuantumCircuit","from qiskit.circuit import Gate, Instruction, Parameter","","from .n_local import NLocal","from ..standard_gates import ("," IGate,"," XGate,"," YGate,"," ZGate,"," RXGate,"," RYGate,"," RZGate,"," HGate,"," SGate,"," SdgGate,"," TGate,"," TdgGate,"," RXXGate,"," RYYGate,"," RZXGate,"," RZZGate,"," SwapGate,"," CXGate,"," CYGate,"," CZGate,"," CRXGate,"," CRYGate,"," CRZGate,"," CHGate,",")","","if typing.TYPE_CHECKING:"," import qiskit # pylint: disable=cyclic-import","","","class TwoLocal(NLocal):"," r\"\"\"The two-local circuit.",""," The two-local circuit is a parameterized circuit consisting of alternating rotation layers and"," entanglement layers. The rotation layers are single qubit gates applied on all qubits."," The entanglement layer uses two-qubit gates to entangle the qubits according to a strategy set"," using ``entanglement``. Both the rotation and entanglement gates can be specified as"," string (e.g. ``'ry'`` or ``'cx'``), as gate-type (e.g. ``RYGate`` or ``CXGate``) or"," as QuantumCircuit (e.g. a 1-qubit circuit or 2-qubit circuit).",""," A set of default entanglement strategies is provided:",""," * ``'full'`` entanglement is each qubit is entangled with all the others."," * ``'linear'`` entanglement is qubit :math:`i` entangled with qubit :math:`i + 1`,"," for all :math:`i \\in \\{0, 1, ... , n - 2\\}`, where :math:`n` is the total number of qubits."," * ``'reverse_linear'`` entanglement is qubit :math:`i` entangled with qubit :math:`i + 1`,"," for all :math:`i \\in \\{n-2, n-3, ... , 1, 0\\}`, where :math:`n` is the total number of qubits."," Note that if ``entanglement_blocks = 'cx'`` then this option provides the same unitary as"," ``'full'`` with fewer entangling gates."," * ``'pairwise'`` entanglement is one layer where qubit :math:`i` is entangled with qubit"," :math:`i + 1`, for all even values of :math:`i`, and then a second layer where qubit :math:`i`"," is entangled with qubit :math:`i + 1`, for all odd values of :math:`i`."," * ``'circular'`` entanglement is linear entanglement but with an additional entanglement of the"," first and last qubit before the linear part."," * ``'sca'`` (shifted-circular-alternating) entanglement is a generalized and modified version"," of the proposed circuit 14 in `Sim et al. `__."," It consists of circular entanglement where the 'long' entanglement connecting the first with"," the last qubit is shifted by one each block. Furthermore the role of control and target"," qubits are swapped every block (therefore alternating).",""," The entanglement can further be specified using an entangler map, which is a list of index"," pairs, such as",""," >>> entangler_map = [(0, 1), (1, 2), (2, 0)]",""," If different entanglements per block should be used, provide a list of entangler maps."," See the examples below on how this can be used.",""," >>> entanglement = [entangler_map_layer_1, entangler_map_layer_2, ... ]",""," Barriers can be inserted in between the different layers for better visualization using the"," ``insert_barriers`` attribute.",""," For each parameterized gate a new parameter is generated using a"," :class:`~qiskit.circuit.library.ParameterVector`. The name of these parameters can be chosen"," using the ``parameter_prefix``.",""," Examples:",""," >>> two = TwoLocal(3, 'ry', 'cx', 'linear', reps=2, insert_barriers=True)"," >>> print(two) # decompose the layers into standard gates"," ┌──────────┐ ░ ░ ┌──────────┐ ░ ░ ┌──────────┐"," q_0: ┤ Ry(θ[0]) ├─░───■────────░─┤ Ry(θ[3]) ├─░───■────────░─┤ Ry(θ[6]) ├"," ├──────────┤ ░ ┌─┴─┐ ░ ├──────────┤ ░ ┌─┴─┐ ░ ├──────────┤"," q_1: ┤ Ry(θ[1]) ├─░─┤ X ├──■───░─┤ Ry(θ[4]) ├─░─┤ X ├──■───░─┤ Ry(θ[7]) ├"," ├──────────┤ ░ └───┘┌─┴─┐ ░ ├──────────┤ ░ └───┘┌─┴─┐ ░ ├──────────┤"," q_2: ┤ Ry(θ[2]) ├─░──────┤ X ├─░─┤ Ry(θ[5]) ├─░──────┤ X ├─░─┤ Ry(θ[8]) ├"," └──────────┘ ░ └───┘ ░ └──────────┘ ░ └───┘ ░ └──────────┘",""," >>> two = TwoLocal(3, ['ry','rz'], 'cz', 'full', reps=1, insert_barriers=True)"," >>> qc = QuantumCircuit(3)"," >>> qc += two"," >>> print(qc.decompose().draw())"," ┌──────────┐┌──────────┐ ░ ░ ┌──────────┐ ┌──────────┐"," q_0: ┤ Ry(θ[0]) ├┤ Rz(θ[3]) ├─░──■──■─────░─┤ Ry(θ[6]) ├─┤ Rz(θ[9]) ├"," ├──────────┤├──────────┤ ░ │ │ ░ ├──────────┤┌┴──────────┤"," q_1: ┤ Ry(θ[1]) ├┤ Rz(θ[4]) ├─░──■──┼──■──░─┤ Ry(θ[7]) ├┤ Rz(θ[10]) ├"," ├──────────┤├──────────┤ ░ │ │ ░ ├──────────┤├───────────┤"," q_2: ┤ Ry(θ[2]) ├┤ Rz(θ[5]) ├─░─────■──■──░─┤ Ry(θ[8]) ├┤ Rz(θ[11]) ├"," └──────────┘└──────────┘ ░ ░ └──────────┘└───────────┘",""," >>> entangler_map = [[0, 1], [1, 2], [2, 0]] # circular entanglement for 3 qubits"," >>> two = TwoLocal(3, 'x', 'crx', entangler_map, reps=1)"," >>> print(two) # note: no barriers inserted this time!"," ┌───┐ ┌──────────┐┌───┐"," q_0: |0>┤ X ├─────■───────────────────────┤ Rx(θ[2]) ├┤ X ├"," ├───┤┌────┴─────┐ ┌───┐└─────┬────┘└───┘"," q_1: |0>┤ X ├┤ Rx(θ[0]) ├─────■──────┤ X ├──────┼──────────"," ├───┤└──────────┘┌────┴─────┐└───┘ │ ┌───┐"," q_2: |0>┤ X ├────────────┤ Rx(θ[1]) ├───────────■─────┤ X ├"," └───┘ └──────────┘ └───┘",""," >>> entangler_map = [[0, 3], [0, 2]] # entangle the first and last two-way"," >>> two = TwoLocal(4, [], 'cry', entangler_map, reps=1)"," >>> circuit = two + two"," >>> print(circuit.decompose().draw()) # note, that the parameters are the same!"," q_0: ─────■───────────■───────────■───────────■──────"," │ │ │ │"," q_1: ─────┼───────────┼───────────┼───────────┼──────"," │ ┌────┴─────┐ │ ┌────┴─────┐"," q_2: ─────┼──────┤ Ry(θ[1]) ├─────┼──────┤ Ry(θ[1]) ├"," ┌────┴─────┐└──────────┘┌────┴─────┐└──────────┘"," q_3: ┤ Ry(θ[0]) ├────────────┤ Ry(θ[0]) ├────────────"," └──────────┘ └──────────┘",""," >>> layer_1 = [(0, 1), (0, 2)]"," >>> layer_2 = [(1, 2)]"," >>> two = TwoLocal(3, 'x', 'cx', [layer_1, layer_2], reps=2, insert_barriers=True)"," >>> print(two)"," ┌───┐ ░ ░ ┌───┐ ░ ░ ┌───┐"," q_0: ┤ X ├─░───■────■───░─┤ X ├─░───────░─┤ X ├"," ├───┤ ░ ┌─┴─┐ │ ░ ├───┤ ░ ░ ├───┤"," q_1: ┤ X ├─░─┤ X ├──┼───░─┤ X ├─░───■───░─┤ X ├"," ├───┤ ░ └───┘┌─┴─┐ ░ ├───┤ ░ ┌─┴─┐ ░ ├───┤"," q_2: ┤ X ├─░──────┤ X ├─░─┤ X ├─░─┤ X ├─░─┤ X ├"," └───┘ ░ └───┘ ░ └───┘ ░ └───┘ ░ └───┘",""," \"\"\"",""," def __init__("," self,"," num_qubits: int | None = None,"," rotation_blocks: ("," str"," | type"," | qiskit.circuit.Instruction"," | QuantumCircuit"," | list[str | type | qiskit.circuit.Instruction | QuantumCircuit]"," | None"," ) = None,"," entanglement_blocks: ("," str"," | type"," | qiskit.circuit.Instruction"," | QuantumCircuit"," | list[str | type | qiskit.circuit.Instruction | QuantumCircuit]"," | None"," ) = None,"," entanglement: str | list[list[int]] | Callable[[int], list[int]] = \"full\","," reps: int = 3,"," skip_unentangled_qubits: bool = False,"," skip_final_rotation_layer: bool = False,"," parameter_prefix: str = \"θ\","," insert_barriers: bool = False,"," initial_state: QuantumCircuit | None = None,"," name: str = \"TwoLocal\","," flatten: bool | None = None,"," ) -> None:"," \"\"\""," Args:"," num_qubits: The number of qubits of the two-local circuit."," rotation_blocks: The gates used in the rotation layer. Can be specified via the name of"," a gate (e.g. ``'ry'``) or the gate type itself (e.g. :class:`.RYGate`)."," If only one gate is provided, the gate same gate is applied to each qubit."," If a list of gates is provided, all gates are applied to each qubit in the provided"," order."," See the Examples section for more detail."," entanglement_blocks: The gates used in the entanglement layer. Can be specified in"," the same format as ``rotation_blocks``."," entanglement: Specifies the entanglement structure. Can be a string (``'full'``,"," ``'linear'``, ``'reverse_linear'``, ``'circular'`` or ``'sca'``),"," a list of integer-pairs specifying the indices"," of qubits entangled with one another, or a callable returning such a list provided with"," the index of the entanglement layer."," Default to ``'full'`` entanglement."," Note that if ``entanglement_blocks = 'cx'``, then ``'full'`` entanglement provides the"," same unitary as ``'reverse_linear'`` but the latter option has fewer entangling gates."," See the Examples section for more detail."," reps: Specifies how often a block consisting of a rotation layer and entanglement"," layer is repeated."," skip_unentangled_qubits: If ``True``, the single qubit gates are only applied to qubits"," that are entangled with another qubit. If ``False``, the single qubit gates are applied"," to each qubit in the ansatz. Defaults to ``False``."," skip_final_rotation_layer: If ``False``, a rotation layer is added at the end of the"," ansatz. If ``True``, no rotation layer is added."," parameter_prefix: The parameterized gates require a parameter to be defined, for which"," we use instances of :class:`~qiskit.circuit.Parameter`. The name of each parameter will"," be this specified prefix plus its index."," insert_barriers: If ``True``, barriers are inserted in between each layer. If ``False``,"," no barriers are inserted. Defaults to ``False``."," initial_state: A :class:`.QuantumCircuit` object to prepend to the circuit."," flatten: Set this to ``True`` to output a flat circuit instead of nesting it inside multiple"," layers of gate objects. By default currently the contents of"," the output circuit will be wrapped in nested objects for"," cleaner visualization. However, if you're using this circuit"," for anything besides visualization its **strongly** recommended"," to set this flag to ``True`` to avoid a large performance"," overhead for parameter binding.",""," \"\"\""," super().__init__("," num_qubits=num_qubits,"," rotation_blocks=rotation_blocks,"," entanglement_blocks=entanglement_blocks,"," entanglement=entanglement,"," reps=reps,"," skip_final_rotation_layer=skip_final_rotation_layer,"," skip_unentangled_qubits=skip_unentangled_qubits,"," insert_barriers=insert_barriers,"," initial_state=initial_state,"," parameter_prefix=parameter_prefix,"," name=name,"," flatten=flatten,"," )",""," def _convert_to_block(self, layer: str | type | Gate | QuantumCircuit) -> QuantumCircuit:"," \"\"\"For a layer provided as str (e.g. ``'ry'``) or type (e.g. :class:`.RYGate`) this function"," returns the"," according layer type along with the number of parameters (e.g. ``(RYGate, 1)``).",""," Args:"," layer: The qubit layer.",""," Returns:"," The specified layer with the required number of parameters.",""," Raises:"," TypeError: The type of ``layer`` is invalid."," ValueError: The type of ``layer`` is str but the name is unknown."," ValueError: The type of ``layer`` is type but the layer type is unknown.",""," Note:"," Outlook: If layers knew their number of parameters as static property, we could also"," allow custom layer types."," \"\"\""," if isinstance(layer, QuantumCircuit):"," return layer",""," # check the list of valid layers"," # this could be a lot easier if the standard layers would have ``name`` and ``num_params``"," # as static types, which might be something they should have anyway"," theta = Parameter(\"θ\")"," valid_layers = {"," \"ch\": CHGate(),"," \"cx\": CXGate(),"," \"cy\": CYGate(),"," \"cz\": CZGate(),"," \"crx\": CRXGate(theta),"," \"cry\": CRYGate(theta),"," \"crz\": CRZGate(theta),"," \"h\": HGate(),"," \"i\": IGate(),"," \"id\": IGate(),"," \"iden\": IGate(),"," \"rx\": RXGate(theta),"," \"rxx\": RXXGate(theta),"," \"ry\": RYGate(theta),"," \"ryy\": RYYGate(theta),"," \"rz\": RZGate(theta),"," \"rzx\": RZXGate(theta),"," \"rzz\": RZZGate(theta),"," \"s\": SGate(),"," \"sdg\": SdgGate(),"," \"swap\": SwapGate(),"," \"x\": XGate(),"," \"y\": YGate(),"," \"z\": ZGate(),"," \"t\": TGate(),"," \"tdg\": TdgGate(),"," }",""," # try to exchange `layer` from a string to a gate instance"," if isinstance(layer, str):"," try:"," layer = valid_layers[layer]"," except KeyError as ex:"," raise ValueError(f\"Unknown layer name `{layer}`.\") from ex",""," # try to exchange `layer` from a type to a gate instance"," if isinstance(layer, type):"," # iterate over the layer types and look for the specified layer"," instance = None"," for gate in valid_layers.values():"," if isinstance(gate, layer):"," instance = gate"," if instance is None:"," raise ValueError(f\"Unknown layer type`{layer}`.\")"," layer = instance",""," if isinstance(layer, Instruction):"," circuit = QuantumCircuit(layer.num_qubits)"," circuit.append(layer, list(range(layer.num_qubits)))"," return circuit",""," raise TypeError("," f\"Invalid input type {type(layer)}. \" + \"`layer` must be a type, str or QuantumCircuit.\""," )",""," def get_entangler_map("," self, rep_num: int, block_num: int, num_block_qubits: int"," ) -> Sequence[Sequence[int]]:"," \"\"\"Overloading to handle the special case of 1 qubit where the entanglement are ignored.\"\"\""," if self.num_qubits <= 1:"," return []"," return super().get_entangler_map(rep_num, block_num, num_block_qubits)"],"stylingDirectives":[[{"start":0,"end":30,"cssClass":"pl-c"}],[{"start":0,"end":1,"cssClass":"pl-c"}],[{"start":0,"end":31,"cssClass":"pl-c"}],[{"start":0,"end":1,"cssClass":"pl-c"}],[{"start":0,"end":70,"cssClass":"pl-c"}],[{"start":0,"end":77,"cssClass":"pl-c"}],[{"start":0,"end":71,"cssClass":"pl-c"}],[{"start":0,"end":1,"cssClass":"pl-c"}],[{"start":0,"end":69,"cssClass":"pl-c"}],[{"start":0,"end":72,"cssClass":"pl-c"}],[{"start":0,"end":49,"cssClass":"pl-c"}],[],[{"start":0,"end":33,"cssClass":"pl-s"}],[],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":16,"end":22,"cssClass":"pl-k"},{"start":23,"end":34,"cssClass":"pl-s1"}],[{"start":0,"end":6,"cssClass":"pl-k"},{"start":7,"end":13,"cssClass":"pl-s1"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":16,"cssClass":"pl-s1"},{"start":17,"end":20,"cssClass":"pl-s1"},{"start":21,"end":27,"cssClass":"pl-k"},{"start":28,"end":36,"cssClass":"pl-v"},{"start":38,"end":46,"cssClass":"pl-v"}],[],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":11,"cssClass":"pl-s1"},{"start":12,"end":19,"cssClass":"pl-s1"},{"start":20,"end":34,"cssClass":"pl-s1"},{"start":35,"end":41,"cssClass":"pl-k"},{"start":42,"end":56,"cssClass":"pl-v"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":11,"cssClass":"pl-s1"},{"start":12,"end":19,"cssClass":"pl-s1"},{"start":20,"end":26,"cssClass":"pl-k"},{"start":27,"end":31,"cssClass":"pl-v"},{"start":33,"end":44,"cssClass":"pl-v"},{"start":46,"end":55,"cssClass":"pl-v"}],[],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":6,"end":13,"cssClass":"pl-s1"},{"start":14,"end":20,"cssClass":"pl-k"},{"start":21,"end":27,"cssClass":"pl-v"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":7,"end":21,"cssClass":"pl-s1"},{"start":22,"end":28,"cssClass":"pl-k"}],[{"start":4,"end":9,"cssClass":"pl-v"}],[{"start":4,"end":9,"cssClass":"pl-v"}],[{"start":4,"end":9,"cssClass":"pl-v"}],[{"start":4,"end":9,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-v"}],[{"start":4,"end":9,"cssClass":"pl-v"}],[{"start":4,"end":9,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":9,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":12,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":11,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-v"}],[],[],[{"start":0,"end":2,"cssClass":"pl-k"},{"start":3,"end":9,"cssClass":"pl-s1"},{"start":10,"end":23,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-k"},{"start":11,"end":17,"cssClass":"pl-s1"},{"start":19,"end":50,"cssClass":"pl-c"}],[],[],[{"start":0,"end":5,"cssClass":"pl-k"},{"start":6,"end":14,"cssClass":"pl-v"},{"start":15,"end":21,"cssClass":"pl-v"}],[{"start":4,"end":30,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":98,"cssClass":"pl-s"}],[{"start":0,"end":90,"cssClass":"pl-s"}],[{"start":0,"end":98,"cssClass":"pl-s"}],[{"start":0,"end":88,"cssClass":"pl-s"}],[{"start":0,"end":87,"cssClass":"pl-s"}],[{"start":0,"end":66,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":57,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":86,"cssClass":"pl-s"}],[{"start":0,"end":97,"cssClass":"pl-s"}],[{"start":0,"end":94,"cssClass":"pl-s"}],[{"start":0,"end":100,"cssClass":"pl-s"}],[{"start":0,"end":95,"cssClass":"pl-s"}],[{"start":0,"end":45,"cssClass":"pl-s"}],[{"start":0,"end":92,"cssClass":"pl-s"}],[{"start":0,"end":100,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":99,"cssClass":"pl-s"}],[{"start":0,"end":50,"cssClass":"pl-s"}],[{"start":0,"end":97,"cssClass":"pl-s"}],[{"start":0,"end":86,"cssClass":"pl-s"}],[{"start":0,"end":98,"cssClass":"pl-s"}],[{"start":0,"end":94,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":94,"cssClass":"pl-s"}],[{"start":0,"end":18,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":48,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":90,"cssClass":"pl-s"}],[{"start":0,"end":51,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":75,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":95,"cssClass":"pl-s"}],[{"start":0,"end":34,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":68,"cssClass":"pl-s"}],[{"start":0,"end":96,"cssClass":"pl-s"}],[{"start":0,"end":35,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":13,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":66,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":86,"cssClass":"pl-s"}],[{"start":0,"end":34,"cssClass":"pl-s"}],[{"start":0,"end":21,"cssClass":"pl-s"}],[{"start":0,"end":40,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":90,"cssClass":"pl-s"}],[{"start":0,"end":64,"cssClass":"pl-s"}],[{"start":0,"end":63,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":83,"cssClass":"pl-s"}],[{"start":0,"end":63,"cssClass":"pl-s"}],[{"start":0,"end":31,"cssClass":"pl-s"}],[{"start":0,"end":88,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":49,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":38,"cssClass":"pl-s"}],[{"start":0,"end":30,"cssClass":"pl-s"}],[{"start":0,"end":90,"cssClass":"pl-s"}],[{"start":0,"end":22,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":7,"cssClass":"pl-s"}],[],[{"start":4,"end":7,"cssClass":"pl-k"},{"start":8,"end":16,"cssClass":"pl-en"}],[{"start":8,"end":12,"cssClass":"pl-s1"}],[{"start":8,"end":18,"cssClass":"pl-s1"},{"start":20,"end":23,"cssClass":"pl-s1"},{"start":24,"end":25,"cssClass":"pl-c1"},{"start":26,"end":30,"cssClass":"pl-c1"},{"start":31,"end":32,"cssClass":"pl-c1"},{"start":33,"end":37,"cssClass":"pl-c1"}],[{"start":8,"end":23,"cssClass":"pl-s1"}],[{"start":12,"end":15,"cssClass":"pl-s1"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-s1"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":20,"cssClass":"pl-s1"},{"start":21,"end":28,"cssClass":"pl-s1"},{"start":29,"end":40,"cssClass":"pl-v"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":28,"cssClass":"pl-v"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-s1"},{"start":19,"end":22,"cssClass":"pl-s1"},{"start":23,"end":24,"cssClass":"pl-c1"},{"start":25,"end":29,"cssClass":"pl-s1"},{"start":30,"end":31,"cssClass":"pl-c1"},{"start":32,"end":38,"cssClass":"pl-s1"},{"start":39,"end":46,"cssClass":"pl-s1"},{"start":47,"end":58,"cssClass":"pl-v"},{"start":59,"end":60,"cssClass":"pl-c1"},{"start":61,"end":75,"cssClass":"pl-v"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-c1"}],[{"start":10,"end":11,"cssClass":"pl-c1"},{"start":12,"end":16,"cssClass":"pl-c1"}],[{"start":8,"end":27,"cssClass":"pl-s1"}],[{"start":12,"end":15,"cssClass":"pl-s1"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-s1"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":20,"cssClass":"pl-s1"},{"start":21,"end":28,"cssClass":"pl-s1"},{"start":29,"end":40,"cssClass":"pl-v"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":28,"cssClass":"pl-v"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-s1"},{"start":19,"end":22,"cssClass":"pl-s1"},{"start":23,"end":24,"cssClass":"pl-c1"},{"start":25,"end":29,"cssClass":"pl-s1"},{"start":30,"end":31,"cssClass":"pl-c1"},{"start":32,"end":38,"cssClass":"pl-s1"},{"start":39,"end":46,"cssClass":"pl-s1"},{"start":47,"end":58,"cssClass":"pl-v"},{"start":59,"end":60,"cssClass":"pl-c1"},{"start":61,"end":75,"cssClass":"pl-v"}],[{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-c1"}],[{"start":10,"end":11,"cssClass":"pl-c1"},{"start":12,"end":16,"cssClass":"pl-c1"}],[{"start":8,"end":20,"cssClass":"pl-s1"},{"start":22,"end":25,"cssClass":"pl-s1"},{"start":26,"end":27,"cssClass":"pl-c1"},{"start":28,"end":32,"cssClass":"pl-s1"},{"start":33,"end":37,"cssClass":"pl-s1"},{"start":38,"end":41,"cssClass":"pl-s1"},{"start":44,"end":45,"cssClass":"pl-c1"},{"start":46,"end":54,"cssClass":"pl-v"},{"start":56,"end":59,"cssClass":"pl-s1"},{"start":62,"end":66,"cssClass":"pl-s1"},{"start":67,"end":70,"cssClass":"pl-s1"},{"start":73,"end":74,"cssClass":"pl-c1"},{"start":75,"end":81,"cssClass":"pl-s"}],[{"start":8,"end":12,"cssClass":"pl-s1"},{"start":14,"end":17,"cssClass":"pl-s1"},{"start":18,"end":19,"cssClass":"pl-c1"},{"start":20,"end":21,"cssClass":"pl-c1"}],[{"start":8,"end":31,"cssClass":"pl-s1"},{"start":33,"end":37,"cssClass":"pl-s1"},{"start":38,"end":39,"cssClass":"pl-c1"},{"start":40,"end":45,"cssClass":"pl-c1"}],[{"start":8,"end":33,"cssClass":"pl-s1"},{"start":35,"end":39,"cssClass":"pl-s1"},{"start":40,"end":41,"cssClass":"pl-c1"},{"start":42,"end":47,"cssClass":"pl-c1"}],[{"start":8,"end":24,"cssClass":"pl-s1"},{"start":26,"end":29,"cssClass":"pl-s1"},{"start":30,"end":31,"cssClass":"pl-c1"},{"start":32,"end":35,"cssClass":"pl-s"}],[{"start":8,"end":23,"cssClass":"pl-s1"},{"start":25,"end":29,"cssClass":"pl-s1"},{"start":30,"end":31,"cssClass":"pl-c1"},{"start":32,"end":37,"cssClass":"pl-c1"}],[{"start":8,"end":21,"cssClass":"pl-s1"},{"start":23,"end":37,"cssClass":"pl-v"},{"start":38,"end":39,"cssClass":"pl-c1"},{"start":40,"end":44,"cssClass":"pl-c1"},{"start":45,"end":46,"cssClass":"pl-c1"},{"start":47,"end":51,"cssClass":"pl-c1"}],[{"start":8,"end":12,"cssClass":"pl-s1"},{"start":14,"end":17,"cssClass":"pl-s1"},{"start":18,"end":19,"cssClass":"pl-c1"},{"start":20,"end":30,"cssClass":"pl-s"}],[{"start":8,"end":15,"cssClass":"pl-s1"},{"start":17,"end":21,"cssClass":"pl-s1"},{"start":22,"end":23,"cssClass":"pl-c1"},{"start":24,"end":28,"cssClass":"pl-c1"},{"start":29,"end":30,"cssClass":"pl-c1"},{"start":31,"end":35,"cssClass":"pl-c1"}],[{"start":6,"end":8,"cssClass":"pl-c1"},{"start":9,"end":13,"cssClass":"pl-c1"}],[{"start":8,"end":11,"cssClass":"pl-s"}],[{"start":0,"end":13,"cssClass":"pl-s"}],[{"start":0,"end":70,"cssClass":"pl-s"}],[{"start":0,"end":99,"cssClass":"pl-s"}],[{"start":0,"end":87,"cssClass":"pl-s"}],[{"start":0,"end":90,"cssClass":"pl-s"}],[{"start":0,"end":99,"cssClass":"pl-s"}],[{"start":0,"end":22,"cssClass":"pl-s"}],[{"start":0,"end":57,"cssClass":"pl-s"}],[{"start":0,"end":94,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":92,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":62,"cssClass":"pl-s"}],[{"start":0,"end":103,"cssClass":"pl-s"}],[{"start":0,"end":52,"cssClass":"pl-s"}],[{"start":0,"end":51,"cssClass":"pl-s"}],[{"start":0,"end":102,"cssClass":"pl-s"}],[{"start":0,"end":102,"cssClass":"pl-s"}],[{"start":0,"end":57,"cssClass":"pl-s"}],[{"start":0,"end":93,"cssClass":"pl-s"}],[{"start":0,"end":34,"cssClass":"pl-s"}],[{"start":0,"end":99,"cssClass":"pl-s"}],[{"start":0,"end":103,"cssClass":"pl-s"}],[{"start":0,"end":67,"cssClass":"pl-s"}],[{"start":0,"end":96,"cssClass":"pl-s"}],[{"start":0,"end":64,"cssClass":"pl-s"}],[{"start":0,"end":98,"cssClass":"pl-s"}],[{"start":0,"end":103,"cssClass":"pl-s"}],[{"start":0,"end":56,"cssClass":"pl-s"}],[{"start":0,"end":100,"cssClass":"pl-s"}],[{"start":0,"end":64,"cssClass":"pl-s"}],[{"start":0,"end":87,"cssClass":"pl-s"}],[{"start":0,"end":104,"cssClass":"pl-s"}],[{"start":0,"end":76,"cssClass":"pl-s"}],[{"start":0,"end":72,"cssClass":"pl-s"}],[{"start":0,"end":76,"cssClass":"pl-s"}],[{"start":0,"end":79,"cssClass":"pl-s"}],[{"start":0,"end":73,"cssClass":"pl-s"}],[{"start":0,"end":47,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":11,"cssClass":"pl-s"}],[{"start":8,"end":13,"cssClass":"pl-en"},{"start":16,"end":24,"cssClass":"pl-en"}],[{"start":12,"end":22,"cssClass":"pl-s1"},{"start":22,"end":23,"cssClass":"pl-c1"},{"start":23,"end":33,"cssClass":"pl-s1"}],[{"start":12,"end":27,"cssClass":"pl-s1"},{"start":27,"end":28,"cssClass":"pl-c1"},{"start":28,"end":43,"cssClass":"pl-s1"}],[{"start":12,"end":31,"cssClass":"pl-s1"},{"start":31,"end":32,"cssClass":"pl-c1"},{"start":32,"end":51,"cssClass":"pl-s1"}],[{"start":12,"end":24,"cssClass":"pl-s1"},{"start":24,"end":25,"cssClass":"pl-c1"},{"start":25,"end":37,"cssClass":"pl-s1"}],[{"start":12,"end":16,"cssClass":"pl-s1"},{"start":16,"end":17,"cssClass":"pl-c1"},{"start":17,"end":21,"cssClass":"pl-s1"}],[{"start":12,"end":37,"cssClass":"pl-s1"},{"start":37,"end":38,"cssClass":"pl-c1"},{"start":38,"end":63,"cssClass":"pl-s1"}],[{"start":12,"end":35,"cssClass":"pl-s1"},{"start":35,"end":36,"cssClass":"pl-c1"},{"start":36,"end":59,"cssClass":"pl-s1"}],[{"start":12,"end":27,"cssClass":"pl-s1"},{"start":27,"end":28,"cssClass":"pl-c1"},{"start":28,"end":43,"cssClass":"pl-s1"}],[{"start":12,"end":25,"cssClass":"pl-s1"},{"start":25,"end":26,"cssClass":"pl-c1"},{"start":26,"end":39,"cssClass":"pl-s1"}],[{"start":12,"end":28,"cssClass":"pl-s1"},{"start":28,"end":29,"cssClass":"pl-c1"},{"start":29,"end":45,"cssClass":"pl-s1"}],[{"start":12,"end":16,"cssClass":"pl-s1"},{"start":16,"end":17,"cssClass":"pl-c1"},{"start":17,"end":21,"cssClass":"pl-s1"}],[{"start":12,"end":19,"cssClass":"pl-s1"},{"start":19,"end":20,"cssClass":"pl-c1"},{"start":20,"end":27,"cssClass":"pl-s1"}],[],[],[{"start":4,"end":7,"cssClass":"pl-k"},{"start":8,"end":25,"cssClass":"pl-en"},{"start":26,"end":30,"cssClass":"pl-s1"},{"start":32,"end":37,"cssClass":"pl-s1"},{"start":39,"end":42,"cssClass":"pl-s1"},{"start":43,"end":44,"cssClass":"pl-c1"},{"start":45,"end":49,"cssClass":"pl-s1"},{"start":50,"end":51,"cssClass":"pl-c1"},{"start":52,"end":56,"cssClass":"pl-v"},{"start":57,"end":58,"cssClass":"pl-c1"},{"start":59,"end":73,"cssClass":"pl-v"},{"start":75,"end":77,"cssClass":"pl-c1"},{"start":78,"end":92,"cssClass":"pl-v"}],[{"start":8,"end":100,"cssClass":"pl-s"}],[{"start":0,"end":20,"cssClass":"pl-s"}],[{"start":0,"end":89,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":13,"cssClass":"pl-s"}],[{"start":0,"end":35,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":16,"cssClass":"pl-s"}],[{"start":0,"end":71,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":15,"cssClass":"pl-s"}],[{"start":0,"end":56,"cssClass":"pl-s"}],[{"start":0,"end":77,"cssClass":"pl-s"}],[{"start":0,"end":84,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":13,"cssClass":"pl-s"}],[{"start":0,"end":96,"cssClass":"pl-s"}],[{"start":0,"end":37,"cssClass":"pl-s"}],[{"start":0,"end":11,"cssClass":"pl-s"}],[{"start":8,"end":10,"cssClass":"pl-k"},{"start":11,"end":21,"cssClass":"pl-en"},{"start":22,"end":27,"cssClass":"pl-s1"},{"start":29,"end":43,"cssClass":"pl-v"}],[{"start":12,"end":18,"cssClass":"pl-k"},{"start":19,"end":24,"cssClass":"pl-s1"}],[],[{"start":8,"end":40,"cssClass":"pl-c"}],[{"start":8,"end":98,"cssClass":"pl-c"}],[{"start":8,"end":75,"cssClass":"pl-c"}],[{"start":8,"end":13,"cssClass":"pl-s1"},{"start":14,"end":15,"cssClass":"pl-c1"},{"start":16,"end":25,"cssClass":"pl-v"},{"start":26,"end":29,"cssClass":"pl-s"}],[{"start":8,"end":20,"cssClass":"pl-s1"},{"start":21,"end":22,"cssClass":"pl-c1"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":24,"cssClass":"pl-v"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":24,"cssClass":"pl-v"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":24,"cssClass":"pl-v"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":24,"cssClass":"pl-v"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"},{"start":27,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"},{"start":27,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"},{"start":27,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":15,"cssClass":"pl-s"},{"start":17,"end":22,"cssClass":"pl-v"}],[{"start":12,"end":15,"cssClass":"pl-s"},{"start":17,"end":22,"cssClass":"pl-v"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":23,"cssClass":"pl-v"}],[{"start":12,"end":18,"cssClass":"pl-s"},{"start":20,"end":25,"cssClass":"pl-v"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":24,"cssClass":"pl-v"},{"start":25,"end":30,"cssClass":"pl-s1"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"},{"start":27,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":24,"cssClass":"pl-v"},{"start":25,"end":30,"cssClass":"pl-s1"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"},{"start":27,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":16,"cssClass":"pl-s"},{"start":18,"end":24,"cssClass":"pl-v"},{"start":25,"end":30,"cssClass":"pl-s1"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"},{"start":27,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"},{"start":27,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":15,"cssClass":"pl-s"},{"start":17,"end":22,"cssClass":"pl-v"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"}],[{"start":12,"end":18,"cssClass":"pl-s"},{"start":20,"end":28,"cssClass":"pl-v"}],[{"start":12,"end":15,"cssClass":"pl-s"},{"start":17,"end":22,"cssClass":"pl-v"}],[{"start":12,"end":15,"cssClass":"pl-s"},{"start":17,"end":22,"cssClass":"pl-v"}],[{"start":12,"end":15,"cssClass":"pl-s"},{"start":17,"end":22,"cssClass":"pl-v"}],[{"start":12,"end":15,"cssClass":"pl-s"},{"start":17,"end":22,"cssClass":"pl-v"}],[{"start":12,"end":17,"cssClass":"pl-s"},{"start":19,"end":26,"cssClass":"pl-v"}],[],[],[{"start":8,"end":66,"cssClass":"pl-c"}],[{"start":8,"end":10,"cssClass":"pl-k"},{"start":11,"end":21,"cssClass":"pl-en"},{"start":22,"end":27,"cssClass":"pl-s1"},{"start":29,"end":32,"cssClass":"pl-s1"}],[{"start":12,"end":15,"cssClass":"pl-k"}],[{"start":16,"end":21,"cssClass":"pl-s1"},{"start":22,"end":23,"cssClass":"pl-c1"},{"start":24,"end":36,"cssClass":"pl-s1"},{"start":37,"end":42,"cssClass":"pl-s1"}],[{"start":12,"end":18,"cssClass":"pl-k"},{"start":19,"end":27,"cssClass":"pl-v"},{"start":28,"end":30,"cssClass":"pl-k"},{"start":31,"end":33,"cssClass":"pl-s1"}],[{"start":16,"end":21,"cssClass":"pl-k"},{"start":22,"end":32,"cssClass":"pl-v"},{"start":33,"end":65,"cssClass":"pl-s"},{"start":55,"end":62,"cssClass":"pl-s1"},{"start":55,"end":56,"cssClass":"pl-kos"},{"start":56,"end":61,"cssClass":"pl-s1"},{"start":61,"end":62,"cssClass":"pl-kos"},{"start":67,"end":71,"cssClass":"pl-k"},{"start":72,"end":74,"cssClass":"pl-s1"}],[],[{"start":8,"end":64,"cssClass":"pl-c"}],[{"start":8,"end":10,"cssClass":"pl-k"},{"start":11,"end":21,"cssClass":"pl-en"},{"start":22,"end":27,"cssClass":"pl-s1"},{"start":29,"end":33,"cssClass":"pl-s1"}],[{"start":12,"end":75,"cssClass":"pl-c"}],[{"start":12,"end":20,"cssClass":"pl-s1"},{"start":21,"end":22,"cssClass":"pl-c1"},{"start":23,"end":27,"cssClass":"pl-c1"}],[{"start":12,"end":15,"cssClass":"pl-k"},{"start":16,"end":20,"cssClass":"pl-s1"},{"start":21,"end":23,"cssClass":"pl-c1"},{"start":24,"end":36,"cssClass":"pl-s1"},{"start":37,"end":43,"cssClass":"pl-en"}],[{"start":16,"end":18,"cssClass":"pl-k"},{"start":19,"end":29,"cssClass":"pl-en"},{"start":30,"end":34,"cssClass":"pl-s1"},{"start":36,"end":41,"cssClass":"pl-s1"}],[{"start":20,"end":28,"cssClass":"pl-s1"},{"start":29,"end":30,"cssClass":"pl-c1"},{"start":31,"end":35,"cssClass":"pl-s1"}],[{"start":12,"end":14,"cssClass":"pl-k"},{"start":15,"end":23,"cssClass":"pl-s1"},{"start":24,"end":26,"cssClass":"pl-c1"},{"start":27,"end":31,"cssClass":"pl-c1"}],[{"start":16,"end":21,"cssClass":"pl-k"},{"start":22,"end":32,"cssClass":"pl-v"},{"start":33,"end":64,"cssClass":"pl-s"},{"start":54,"end":61,"cssClass":"pl-s1"},{"start":54,"end":55,"cssClass":"pl-kos"},{"start":55,"end":60,"cssClass":"pl-s1"},{"start":60,"end":61,"cssClass":"pl-kos"}],[{"start":12,"end":17,"cssClass":"pl-s1"},{"start":18,"end":19,"cssClass":"pl-c1"},{"start":20,"end":28,"cssClass":"pl-s1"}],[],[{"start":8,"end":10,"cssClass":"pl-k"},{"start":11,"end":21,"cssClass":"pl-en"},{"start":22,"end":27,"cssClass":"pl-s1"},{"start":29,"end":40,"cssClass":"pl-v"}],[{"start":12,"end":19,"cssClass":"pl-s1"},{"start":20,"end":21,"cssClass":"pl-c1"},{"start":22,"end":36,"cssClass":"pl-v"},{"start":37,"end":42,"cssClass":"pl-s1"},{"start":43,"end":53,"cssClass":"pl-s1"}],[{"start":12,"end":19,"cssClass":"pl-s1"},{"start":20,"end":26,"cssClass":"pl-en"},{"start":27,"end":32,"cssClass":"pl-s1"},{"start":34,"end":38,"cssClass":"pl-en"},{"start":39,"end":44,"cssClass":"pl-en"},{"start":45,"end":50,"cssClass":"pl-s1"},{"start":51,"end":61,"cssClass":"pl-s1"}],[{"start":12,"end":18,"cssClass":"pl-k"},{"start":19,"end":26,"cssClass":"pl-s1"}],[],[{"start":8,"end":13,"cssClass":"pl-k"},{"start":14,"end":23,"cssClass":"pl-v"}],[{"start":12,"end":49,"cssClass":"pl-s"},{"start":33,"end":46,"cssClass":"pl-s1"},{"start":33,"end":34,"cssClass":"pl-kos"},{"start":34,"end":38,"cssClass":"pl-en"},{"start":39,"end":44,"cssClass":"pl-s1"},{"start":45,"end":46,"cssClass":"pl-kos"},{"start":50,"end":51,"cssClass":"pl-c1"},{"start":52,"end":100,"cssClass":"pl-s"}],[],[],[{"start":4,"end":7,"cssClass":"pl-k"},{"start":8,"end":25,"cssClass":"pl-en"}],[{"start":8,"end":12,"cssClass":"pl-s1"},{"start":14,"end":21,"cssClass":"pl-s1"},{"start":23,"end":26,"cssClass":"pl-s1"},{"start":28,"end":37,"cssClass":"pl-s1"},{"start":39,"end":42,"cssClass":"pl-s1"},{"start":44,"end":60,"cssClass":"pl-s1"},{"start":62,"end":65,"cssClass":"pl-s1"}],[{"start":6,"end":8,"cssClass":"pl-c1"},{"start":9,"end":17,"cssClass":"pl-v"},{"start":18,"end":26,"cssClass":"pl-v"},{"start":27,"end":30,"cssClass":"pl-s1"}],[{"start":8,"end":99,"cssClass":"pl-s"}],[{"start":8,"end":10,"cssClass":"pl-k"},{"start":11,"end":15,"cssClass":"pl-s1"},{"start":16,"end":26,"cssClass":"pl-s1"},{"start":27,"end":29,"cssClass":"pl-c1"},{"start":30,"end":31,"cssClass":"pl-c1"}],[{"start":12,"end":18,"cssClass":"pl-k"}],[{"start":8,"end":14,"cssClass":"pl-k"},{"start":15,"end":20,"cssClass":"pl-en"},{"start":23,"end":40,"cssClass":"pl-en"},{"start":41,"end":48,"cssClass":"pl-s1"},{"start":50,"end":59,"cssClass":"pl-s1"},{"start":61,"end":77,"cssClass":"pl-s1"}]],"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/Qiskit/qiskit/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"two_local.py","displayUrl":"https://github.com/Qiskit/qiskit/blob/main/qiskit/circuit/library/n_local/two_local.py?raw=true","headerInfo":{"blobSize":"17.6 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"0663773","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FQiskit%2Fqiskit%2Fblob%2Fmain%2Fqiskit%2Fcircuit%2Flibrary%2Fn_local%2Ftwo_local.py","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"338","truncatedSloc":"302"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Python","languageID":303,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/Qiskit/qiskit/blob/main/qiskit/circuit/library/n_local/two_local.py","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/Qiskit/qiskit/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/Qiskit/qiskit/raw/main/qiskit/circuit/library/n_local/two_local.py","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":4,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"TwoLocal","kind":"class","ident_start":1168,"ident_end":1176,"extent_start":1162,"extent_end":18024,"fully_qualified_name":"TwoLocal","ident_utf16":{"start":{"line_number":53,"utf16_col":6},"end":{"line_number":53,"utf16_col":14}},"extent_utf16":{"start":{"line_number":53,"utf16_col":0},"end":{"line_number":337,"utf16_col":78}}},{"name":"__init__","kind":"function","ident_start":10052,"ident_end":10060,"extent_start":10048,"extent_end":14611,"fully_qualified_name":"TwoLocal.__init__","ident_utf16":{"start":{"line_number":162,"utf16_col":8},"end":{"line_number":162,"utf16_col":16}},"extent_utf16":{"start":{"line_number":162,"utf16_col":4},"end":{"line_number":246,"utf16_col":9}}},{"name":"_convert_to_block","kind":"function","ident_start":14621,"ident_end":14638,"extent_start":14617,"extent_end":17662,"fully_qualified_name":"TwoLocal._convert_to_block","ident_utf16":{"start":{"line_number":248,"utf16_col":8},"end":{"line_number":248,"utf16_col":25}},"extent_utf16":{"start":{"line_number":248,"utf16_col":4},"end":{"line_number":329,"utf16_col":9}}},{"name":"get_entangler_map","kind":"function","ident_start":17672,"ident_end":17689,"extent_start":17668,"extent_end":18024,"fully_qualified_name":"TwoLocal.get_entangler_map","ident_utf16":{"start":{"line_number":331,"utf16_col":8},"end":{"line_number":331,"utf16_col":25}},"extent_utf16":{"start":{"line_number":331,"utf16_col":4},"end":{"line_number":337,"utf16_col":78}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/Qiskit/qiskit/branches":{"post":"ZFg6nfpR3_w3Er2an_7G-4Zh2gcfKcWpMKYxOWXy-ykUxgcd0qtcFJCcj18WsnYNty4JjAaE_iLqlI9LfL4xpQ"},"/repos/preferences":{"post":"RkdGbFkwpHSvwRP7dZ7pKLlR2XkF3ubQEw3dzD2MKEgQqakFDJj6CViGk0y8P9t0JBkBnSM-KVc92acGRfU_Uw"}}},"title":"qiskit/qiskit/circuit/library/n_local/two_local.py at main · Qiskit/qiskit"}