コード例 #1
0
    def sampler(
        self, processor_id: Union[str, List[str]], gate_set: Serializer
    ) -> engine_sampler.QuantumEngineSampler:
        """Returns a sampler backed by the engine.

        Args:
            processor_id: String identifier, or list of string identifiers,
                determining which processors may be used when sampling.
            gate_set: Determines how to serialize circuits when requesting
                samples.
        """
        return engine_sampler.QuantumEngineSampler(
            engine=self, processor_id=processor_id, gate_set=gate_set
        )
コード例 #2
0
    def get_sampler(
        self,
        gate_set: Optional[serializer.Serializer] = None
    ) -> engine_sampler.QuantumEngineSampler:
        """Returns a sampler backed by the engine.

        Args:
            gate_set: A `Serializer` that determines how to serialize circuits
            when requesting samples. If not specified, uses proto v2.5 serialization.

        Returns:
            A `cirq.Sampler` instance (specifically a `engine_sampler.QuantumEngineSampler`
            that will send circuits to the Quantum Computing Service
            when sampled.1
        """
        return engine_sampler.QuantumEngineSampler(
            engine=self.engine(), processor_id=self.processor_id)
コード例 #3
0
ファイル: engine.py プロジェクト: 95-martin-orion/Cirq
    def get_sampler(
            self, processor_id: Union[str, List[str]],
            gate_set: Serializer) -> engine_sampler.QuantumEngineSampler:
        """Returns a sampler backed by the engine.

        Args:
            processor_id: String identifier, or list of string identifiers,
                determining which processors may be used when sampling.
            gate_set: A `Serializer` that determines how to serialize
                 circuits when requesting samples.

        Returns:
            A `cirq.Sampler` instance (specifically a `engine_sampler.QuantumEngineSampler`
            that will send circuits to the Quantum Computing Service
            when sampled.
        """
        return engine_sampler.QuantumEngineSampler(engine=self,
                                                   processor_id=processor_id,
                                                   gate_set=gate_set)
コード例 #4
0
ファイル: engine_processor.py プロジェクト: kevinsung/Cirq
    def get_sampler(
        self, gate_set: Optional[serializer.Serializer]
    ) -> engine_sampler.QuantumEngineSampler:
        """Returns a sampler backed by the engine.

        Args:
            gate_set: A `Serializer` that determines how to serialize circuits
            when requesting samples.

        Returns:
            A `cirq.Sampler` instance (specifically a `engine_sampler.QuantumEngineSampler`
            that will send circuits to the Quantum Computing Service
            when sampled.1
        """
        return engine_sampler.QuantumEngineSampler(
            engine=self.engine(),
            processor_id=self.processor_id,
            gate_set=gate_set or circuit_serializer.CIRCUIT_SERIALIZER,
        )