An internal method to bypass some checking when directly appending a standard gate.
(
self,
op: StandardGate,
qargs: Sequence[QubitSpecifier] = (),
params: Sequence[ParameterValueType] = (),
label: str | None = None,
)
| 2805 | return self._data._cbit_argument_conversion(clbit_representation) |
| 2806 | |
| 2807 | def _append_standard_gate( |
| 2808 | self, |
| 2809 | op: StandardGate, |
| 2810 | qargs: Sequence[QubitSpecifier] = (), |
| 2811 | params: Sequence[ParameterValueType] = (), |
| 2812 | label: str | None = None, |
| 2813 | ) -> InstructionSet: |
| 2814 | """An internal method to bypass some checking when directly appending a standard gate.""" |
| 2815 | circuit_scope = self._current_scope() |
| 2816 | |
| 2817 | if params is None: |
| 2818 | params = [] |
| 2819 | |
| 2820 | expanded_qargs = [self._qbit_argument_conversion(qarg) for qarg in qargs or []] |
| 2821 | for param in params: |
| 2822 | Gate.validate_parameter(op, param) |
| 2823 | |
| 2824 | instructions = InstructionSet(resource_requester=circuit_scope.resolve_classical_resource) |
| 2825 | for qarg, _ in Gate.broadcast_arguments(op, expanded_qargs, []): |
| 2826 | self._check_dups(qarg) |
| 2827 | instruction = CircuitInstruction.from_standard(op, qarg, params, label=label) |
| 2828 | circuit_scope.append(instruction, _standard_gate=True) |
| 2829 | instructions._add_ref(circuit_scope.instructions, len(circuit_scope.instructions) - 1) |
| 2830 | return instructions |
| 2831 | |
| 2832 | def append( |
| 2833 | self, |
no test coverage detected