constructor(
initial_num_moments: number,
symbols: SymbolInformation[],
padding_factor = 1
) {
super();
this.padding_factor = padding_factor;
this.qubit_map = new Map();
for (const symbol of symbols) {
// Being accurate is more important than speed here, so
// traversing through each object isn't a big deal.
// However, this logic can be changed if needed to avoid redundancy.
for (const coordinate of symbol.location_info) {
// If the key already exists in the map, don't repeat.
if (this.hasQubit(coordinate.row, coordinate.col)) {
continue;
}
this.addQubit(coordinate.row, coordinate.col, initial_num_moments);
}
this.addSymbol(symbol, initial_num_moments);
}
}
Associated Context | |
---|---|
Type | Code Snippet ( .ts ) |
Associated Tags | cirq |
Description | 'No Description Provided' |
Related Links | https://github.com/davidmerwin http://quantumai.google/cirq |
Related People | David Merwin, David Jeffrey Merwin, CIRQ |
Sensitive Information | No Sensitive Information Detected |
Shareable Link | https://davidmerwin.pieces.cloud/?p=d9df4fb4e9 |