qiskit/transpiler/passes/mapping/trivial_layout.py
def run(self, dag):
        """
        Pick a layout by assigning n circuit qubits to device qubits 0, .., n-1.

        Args:
            dag (DAGCircuit): DAG to find layout for.

        Raises:
            TranspilerError: if dag wider than self.coupling_map
        """
        num_dag_qubits = sum([qreg.size for qreg in dag.qregs.values()])
        if num_dag_qubits > self.coupling_map.size():
            raise TranspilerError('Number of qubits greater than device.')
        self.property_set['layout'] = Layout.generate_trivial_layout(*dag.qregs.values())
def run(self, dag):
        num_dag_qubits = sum([qreg.size for qreg in dag.qregs.values()])
        if num_dag_qubits > self.coupling_map.size():
            raise TranspilerError('Number of qubits greater than device.')
        self.property_set['layout'] = Layout.generate_trivial_layout(*dag.qregs.values())
def run ( self , dag ) : num_dag_qubits = sum ( [ qreg . size for qreg in dag . qregs . values ( ) ] ) if num_dag_qubits > self . coupling_map . size ( ) : raise TranspilerError ( 'Number of qubits greater than device.' ) self . property_set [ 'layout' ] = Layout . generate_trivial_layout ( * dag . qregs . values ( ) )
Pick a layout by assigning n circuit qubits to device qubits 0, .., n-1.

        Args:
            dag (DAGCircuit): DAG to find layout for.

        Raises:
            TranspilerError: if dag wider than self.coupling_map
Pick a layout by assigning n circuit qubits to device qubits 0 .. n - 1 .