本文整理汇总了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)