Skip to content

Commit 625c2c1

Browse files
committed
Remove deprecated method cirq_google.Engine.sampler()
Long past the `v1.0` deprecation deadline.
1 parent 7c0fba7 commit 625c2c1

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

cirq-google/cirq_google/engine/engine.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
from google.protobuf import any_pb2
3535

3636
import cirq
37-
from cirq._compat import deprecated
3837
from cirq_google.api import v2
3938
from cirq_google.engine import (
4039
abstract_engine,
@@ -564,21 +563,6 @@ def get_processor(self, processor_id: str) -> engine_processor.EngineProcessor:
564563
"""
565564
return engine_processor.EngineProcessor(self.project_id, processor_id, self.context)
566565

567-
@deprecated(deadline="v1.0", fix="Use get_sampler instead.")
568-
def sampler(self, processor_id: Union[str, List[str]]) -> 'cirq_google.ProcessorSampler':
569-
"""Returns a sampler backed by the engine.
570-
571-
Args:
572-
processor_id: String identifier, or list of string identifiers,
573-
determining which processors may be used when sampling.
574-
575-
Returns:
576-
A `cirq.Sampler` instance (specifically a `engine_sampler.ProcessorSampler`
577-
that will send circuits to the Quantum Computing Service
578-
when sampled.
579-
"""
580-
return self.get_sampler(processor_id)
581-
582566
def get_sampler(
583567
self, processor_id: Union[str, List[str]], run_name: str = "", device_config_name: str = ""
584568
) -> 'cirq_google.ProcessorSampler':

cirq-google/cirq_google/engine/engine_test.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -741,9 +741,6 @@ def test_sampler_with_unary_rpcs(client):
741741
assert results[i].measurements == {'q': np.array([[0]], dtype='uint8')}
742742
assert client().create_program_async.call_args[0][0] == 'proj'
743743

744-
with cirq.testing.assert_deprecated('sampler', deadline='1.0'):
745-
_ = engine.sampler(processor_id='tmp')
746-
747744
with pytest.raises(ValueError, match='list of processors'):
748745
_ = engine.get_sampler(['test1', 'test2'])
749746

@@ -764,9 +761,6 @@ def test_sampler_with_stream_rpcs(client):
764761
assert results[i].measurements == {'q': np.array([[0]], dtype='uint8')}
765762
assert client().run_job_over_stream.call_args[1]['project_id'] == 'proj'
766763

767-
with cirq.testing.assert_deprecated('sampler', deadline='1.0'):
768-
_ = engine.sampler(processor_id='tmp')
769-
770764
with pytest.raises(ValueError, match='list of processors'):
771765
_ = engine.get_sampler(['test1', 'test2'])
772766

docs/google/engine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ circuit = cirq.Circuit(
8080
engine = cg.Engine(project_id=YOUR_PROJECT_ID)
8181

8282
# Create a sampler from the engine
83-
sampler = engine.sampler(processor_id='PROCESSOR_ID', gate_set=cg.SYC_GATESET)
83+
sampler = engine.get_sampler(processor_id='PROCESSOR_ID')
8484

8585
# This will run the circuit and return the results in a 'Result'
8686
results = sampler.run(circuit, repetitions=1000)

0 commit comments

Comments
 (0)