def test_cmd_def_schedules_unaltered(self):
    "Test that forward scheduling doesn't change relative timing with a command."
    q = QuantumRegister(2)
    c = ClassicalRegister(2)
    qc = QuantumCircuit(q, c)
    qc.cx(q[0], q[1])
    sched1 = schedule(qc, self.backend, method='as_soon_as_possible')
    sched2 = schedule(qc, self.backend, method='as_late_as_possible')
    self.assertEqual(sched1.instructions, sched2.instructions)
    insts = sched1.instructions
    self.assertEqual(insts[0][0], 0)
    self.assertEqual(insts[1][0], 10)
    self.assertEqual(insts[2][0], 20)
    self.assertEqual(insts[3][0], 20)
Test that forward scheduling doesn't change relative timing with a command.
def test_cmd_def_schedules_unaltered(self):
    
    q = QuantumRegister(2)
    c = ClassicalRegister(2)
    qc = QuantumCircuit(q, c)
    qc.cx(q[0], q[1])
    sched1 = schedule(qc, self.backend, method='as_soon_as_possible')
    sched2 = schedule(qc, self.backend, method='as_late_as_possible')
    self.assertEqual(sched1.instructions, sched2.instructions)
    insts = sched1.instructions
    self.assertEqual(insts[0][0], 0)
    self.assertEqual(insts[1][0], 10)
    self.assertEqual(insts[2][0], 20)
    self.assertEqual(insts[3][0], 20)