English
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

qiskit.transpiler.Target.from_configuration

classmethod Target.from_configuration(basis_gates, num_qubits=None, coupling_map=None, inst_map=None, backend_properties=None, instruction_durations=None, dt=None, timing_constraints=None, custom_name_mapping=None)[source]

Create a target object from the individual global configuration

Prior to the creation of the Target class, the constraints of a backend were represented by a collection of different objects which combined represent a subset of the information contained in the Target. This function provides a simple interface to convert those separate objects to a Target.

This constructor will use the input from basis_gates, num_qubits, and coupling_map to build a base model of the backend and the instruction_durations, backend_properties, and inst_map inputs are then queried (in that order) based on that model to look up the properties of each instruction and qubit. If there is an inconsistency between the inputs any extra or conflicting information present in instruction_durations, backend_properties, or inst_map will be ignored.

Parameters
  • basis_gates (List[str]) – The list of basis gate names for the backend. For the target to be created these names must either be in the output from :func:~.get_standard_gate_name_mapping` or present in the specified custom_name_mapping argument.

  • num_qubits (Optional[int]) – The number of qubits supported on the backend.

  • coupling_map (Optional[CouplingMap]) – The coupling map representing connectivity constraints on the backend. If specified all gates from basis_gates will be supported on all qubits (or pairs of qubits).

  • inst_map (Optional[InstructionScheduleMap]) – The instruction schedule map representing the pulse Schedule definitions for each instruction. If this is specified coupling_map must be specified. The coupling_map is used as the source of truth for connectivity and if inst_map is used the schedule is looked up based on the instuctions from the pair of basis_gates and coupling_map. If you want to define a custom gate for a particular qubit or qubit pair, you can manually build Target.

  • backend_properties (Optional[BackendProperties]) – The BackendProperties object which is used for instruction properties and qubit properties. If specified and instruction properties are intended to be used then the coupling_map argument must be specified. This is only used to lookup error rates and durations (unless instruction_durations is specified which would take precedence) for instructions specified via coupling_map and basis_gates.

  • instruction_durations (Optional[InstructionDurations]) – Optional instruction durations for instructions. If specified it will take priority for setting the duration field in the InstructionProperties objects for the instructions in the target.

  • dt (Optional[float]) – The system time resolution of input signals in seconds

  • timing_constraints (Optional[TimingConstraints]) – Optional timing constraints to include in the Target

  • custom_name_mapping (Optional[Dict[str, Any]]) – An optional dictionary that maps custom gate/operation names in basis_gates to an Operation object representing that gate/operation. By default most standard gates names are mapped to the standard gate object from qiskit.circuit.library this only needs to be specified if the input basis_gates defines gates in names outside that set.

Returns

the target built from the input configuration

Return type

Target

Raises
  • TranspilerError – If the input basis gates contain > 2 qubits and coupling_map is

  • specified.

  • KeyError – If no mappign is available for a specified basis_gate.