Skip to content

Commit f5d9029

Browse files
committed
Rename register_block to add_block
1 parent bc6df32 commit f5d9029

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

crates/circuit/src/dag_circuit.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ impl DAGCircuit {
16801680
let block_map = other
16811681
.iter_blocks()
16821682
.enumerate()
1683-
.map(|(index, block)| (Block::new(index), self.register_block(block.clone())))
1683+
.map(|(index, block)| (Block::new(index), self.add_block(block.clone())))
16841684
.collect();
16851685

16861686
// Compose
@@ -3051,7 +3051,7 @@ impl DAGCircuit {
30513051
Some(Parameters::Blocks(circuits)) => Python::attach(|py| -> PyResult<_> {
30523052
let mut blocks = Vec::with_capacity(circuits.len());
30533053
for circuit in circuits {
3054-
blocks.push(self.register_block(circuit_to_dag(
3054+
blocks.push(self.add_block(circuit_to_dag(
30553055
circuit.extract(py)?,
30563056
false,
30573057
None,
@@ -3136,7 +3136,7 @@ impl DAGCircuit {
31363136
let block_map = input_dag
31373137
.iter_blocks()
31383138
.enumerate()
3139-
.map(|(index, block)| (Block::new(index), self.register_block(block.clone())))
3139+
.map(|(index, block)| (Block::new(index), self.add_block(block.clone())))
31403140
.collect();
31413141

31423142
type WireMapsTuple = (
@@ -4231,7 +4231,7 @@ impl DAGCircuit {
42314231
.map(|b| {
42324232
*block_map.entry(*b).or_insert_with(|| {
42334233
let block = self.blocks.get(b.index()).unwrap().clone();
4234-
new_layer.register_block(block)
4234+
new_layer.add_block(block)
42354235
})
42364236
})
42374237
.collect();
@@ -5050,7 +5050,7 @@ impl DAGCircuit {
50505050
/// No attempt is made to deduplicate the given block.
50515051
/// No validation is performed to ensure that the given block is valid
50525052
/// within the DAG.
5053-
pub fn register_block(&mut self, block: DAGCircuit) -> Block {
5053+
pub fn add_block(&mut self, block: DAGCircuit) -> Block {
50545054
let id = self.blocks.len();
50555055
self.blocks.push(block);
50565056
Block::new(id)
@@ -8768,7 +8768,7 @@ impl DAGCircuitBuilder {
87688768
/// within this DAG.
87698769
#[inline]
87708770
pub fn register_block(&mut self, block: DAGCircuit) -> Block {
8771-
self.dag.register_block(block)
8771+
self.dag.add_block(block)
87728772
}
87738773
}
87748774

crates/transpiler/src/passes/disjoint_layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ pub fn distribute_components(dag: &mut DAGCircuit, target: &Target) -> PyResult<
215215
.iter_blocks()
216216
.enumerate()
217217
.map(|(index, block)| {
218-
(Block::new(index), out_dag.register_block(block.clone()))
218+
(Block::new(index), out_dag.add_block(block.clone()))
219219
})
220220
.collect();
221221
out_dag.compose(
@@ -469,7 +469,7 @@ fn separate_dag(dag: &mut DAGCircuit) -> PyResult<Vec<DAGCircuit>> {
469469
.map(|b| {
470470
*block_map.entry(*b).or_insert_with(|| {
471471
let block = dag.view_block(*b).clone();
472-
new_dag.register_block(block)
472+
new_dag.add_block(block)
473473
})
474474
})
475475
.collect(),

0 commit comments

Comments
 (0)