本文整理匯總了Python中qctoolkit.pulses.table_pulse_template.TablePulseTemplate.build_sequence方法的典型用法代碼示例。如果您正苦於以下問題:Python TablePulseTemplate.build_sequence方法的具體用法?Python TablePulseTemplate.build_sequence怎麽用?Python TablePulseTemplate.build_sequence使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qctoolkit.pulses.table_pulse_template.TablePulseTemplate
的用法示例。
在下文中一共展示了TablePulseTemplate.build_sequence方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_build_sequence
# 需要導入模塊: from qctoolkit.pulses.table_pulse_template import TablePulseTemplate [as 別名]
# 或者: from qctoolkit.pulses.table_pulse_template.TablePulseTemplate import build_sequence [as 別名]
def test_build_sequence(self) -> None:
table = TablePulseTemplate()
foo_decl = ParameterDeclaration('foo', min=1)
bar_decl = ParameterDeclaration('bar')
table.add_entry(foo_decl, 'v', 'linear')
table.add_entry(bar_decl, 0, 'jump')
parameters = {'v': 2.3, 'foo': 1, 'bar': 4}
instantiated_entries = tuple(table.get_entries_instantiated(parameters))
sequencer = DummySequencer()
instruction_block = DummyInstructionBlock()
table.build_sequence(sequencer, parameters, {}, instruction_block)
waveform = TableWaveform(instantiated_entries)
self.assertEqual(1, len(instruction_block.instructions))
instruction = instruction_block.instructions[0]
self.assertIsInstance(instruction, EXECInstruction)
self.assertEqual(waveform, instruction.waveform)
示例2: test_build_sequence_empty
# 需要導入模塊: from qctoolkit.pulses.table_pulse_template import TablePulseTemplate [as 別名]
# 或者: from qctoolkit.pulses.table_pulse_template.TablePulseTemplate import build_sequence [as 別名]
def test_build_sequence_empty(self) -> None:
table = TablePulseTemplate()
sequencer = DummySequencer()
instruction_block = DummyInstructionBlock()
table.build_sequence(sequencer, {}, {}, instruction_block)
self.assertFalse(instruction_block.instructions)