Skip to content

simple_mappers

This module contains the following simple mappers:

  • IdentityMapper
  • HardcodedMapper

HardcodedMapper

Bases: Mapper

Source code in opensquirrel\mapper\simple_mappers.py
class HardcodedMapper(Mapper):
    def __init__(self, qubit_register_size: int, mapping: Mapping) -> None:
        """A ``HardcodedMapper`` maps each virtual qubit to a hardcoded physical qubit"""
        super().__init__(qubit_register_size, mapping)

__init__(qubit_register_size, mapping)

A HardcodedMapper maps each virtual qubit to a hardcoded physical qubit

Source code in opensquirrel\mapper\simple_mappers.py
def __init__(self, qubit_register_size: int, mapping: Mapping) -> None:
    """A ``HardcodedMapper`` maps each virtual qubit to a hardcoded physical qubit"""
    super().__init__(qubit_register_size, mapping)

IdentityMapper

Bases: Mapper

Source code in opensquirrel\mapper\simple_mappers.py
class IdentityMapper(Mapper):
    def __init__(self, qubit_register_size: int) -> None:
        """An ``IdentityMapper`` maps each virtual qubit to exactly the same physical qubit."""
        super().__init__(qubit_register_size)

__init__(qubit_register_size)

An IdentityMapper maps each virtual qubit to exactly the same physical qubit.

Source code in opensquirrel\mapper\simple_mappers.py
def __init__(self, qubit_register_size: int) -> None:
    """An ``IdentityMapper`` maps each virtual qubit to exactly the same physical qubit."""
    super().__init__(qubit_register_size)