supergrad.scgraph.MPCFluxonium1D

supergrad.scgraph.MPCFluxonium1D#

class supergrad.scgraph.MPCFluxonium1D(n_qubit: int | None = None, periodic=None, seed=None, **kwargs)[source]#

The general graph for 1d multipath coupling fluxonium chain. One could select a 3-frequency pattern and decide the number of qubits in the chain. The graph is then used to create a quantum processor, and one could attach control pulse to any qubit using class method.

Parameters:
  • n_qubit (int) – number of qubits in the chain

  • periodic (bool) – whether the chain is periodic(the chain becomes a loop) or not

  • seed (int, optional) – random seed for the graph to add variation. Defaults to None.

__init__(n_qubit: int | None = None, periodic=None, seed=None, **kwargs)[source]#

Initialize a graph with edges, name, or graph attributes.

Parameters:
  • incoming_graph_data (input graph (optional, default: None)) – Data to initialize graph. If None (default) an empty graph is created. The data can be an edge list, or any NetworkX graph object. If the corresponding optional Python packages are installed the data can also be a 2D NumPy array, a SciPy sparse array, or a PyGraphviz graph.

  • attr (keyword arguments, optional (default= no attributes)) – Attributes to add to graph as key=value pairs.

See also

convert

Examples

>>> G = nx.Graph()  # or DiGraph, MultiGraph, MultiDiGraph, etc
>>> G = nx.Graph(name="my graph")
>>> e = [(1, 2), (2, 3), (3, 4)]  # list of edges
>>> G = nx.Graph(e)

Arbitrary graph attribute pairs (key=value) may be assigned

>>> G = nx.Graph(e, day="Friday")
>>> G.graph
{'day': 'Friday'}

Methods

__init__([n_qubit, periodic, seed])

Initialize a graph with edges, name, or graph attributes.

add_edge(u_of_edge, v_of_edge, **attr)

Add an edge between u and v.

add_edges_from(ebunch_to_add, **attr)

Add all the edges in ebunch_to_add.

add_lcj_params_variance_to_graph([...])

Assign (random) values of variance to superconducting qubits' parameters ['ec', 'ej', 'el'] in the graph.

add_node(node_for_adding, **attr)

Add a single node node_for_adding and update node attributes.

add_nodes_from(nodes_for_adding, **attr)

Add multiple nodes.

add_weighted_edges_from(ebunch_to_add[, weight])

Add weighted edges in ebunch_to_add with specified weight attr

adjacency()

Returns an iterator over (node, adjacency dict) tuples for all nodes.

clear()

Remove all nodes and edges from the graph.

clear_edges()

Remove all edges from the graph without altering nodes.

compute_static_properties(list_drive_subsys, ...)

Compute static properties of the model.

compute_static_properties_minimal(...)

Compute static properties of the minimal drive subsystem, as an approach to find quantum gate initial guesses.

convert_graph_to_comp_initial_guess([...])

Convert a networkX graph to virtual compensation initial guess.

convert_graph_to_parameters_haiku([...])

Convert a networkX graph to Haiku's parameters dictionary.

convert_graph_to_pulse_lst(hilbert_space, ...)

Obtain the pulse list and the max length of all pulses.

convert_graph_to_pulse_parameters_haiku([...])

Convert a networkX graph to Haiku's parameters dictionary.

convert_graph_to_quantum_system([...])

Convert a networkX graph to SuperGrad quantum system.

copy([as_view])

Returns a copy of the graph.

create_cr_pulse(ix_control_list, ...[, ...])

Creates CR pulses in the quantum processor.

create_single_qubit_pulse(ix_qubit_list, ...)

Creates single qubit pulses in the quantum processor.

edge_subgraph(edges)

Returns the subgraph induced by the specified edges.

get_edge_data(u, v[, default])

Returns the attribute dictionary associated with edge (u, v).

has_edge(u, v)

Returns True if the edge (u, v) is in the graph.

has_node(n)

Returns True if the graph contains the node n.

is_directed()

Returns True if graph is directed, False otherwise.

is_multigraph()

Returns True if graph is a multigraph, False otherwise.

nbunch_iter([nbunch])

Returns an iterator over nodes contained in nbunch that are also in the graph.

neighbors(n)

Returns an iterator over all neighbors of node n.

number_of_edges([u, v])

Returns the number of edges between two nodes.

number_of_nodes()

Returns the number of nodes in the graph.

order()

Returns the number of nodes in the graph.

remove_edge(u, v)

Remove the edge between u and v.

remove_edges_from(ebunch)

Remove all edges specified in ebunch.

remove_node(n)

Remove node n.

remove_nodes_from(nodes)

Remove multiple nodes.

remove_pulse()

Remove pulse parameters from the graph

size([weight])

Returns the number of edges or total of all edge weights.

subgraph(nodes)

Returns a SubGraph view of the subgraph induced on nodes.

to_directed([as_view])

Returns a directed representation of the graph.

to_directed_class()

Returns the class to use for empty directed copies.

to_undirected([as_view])

Returns an undirected copy of the graph.

to_undirected_class()

Returns the class to use for empty undirected copies.

tree_flatten()

Specifies a flattening recipe.

tree_unflatten(aux_data, children)

Specifies an unflattening recipe.

update([edges, nodes])

Update the graph using nodes/edges/graphs as input.

update_params(params[, share_params, ...])

Update parameters to networkX Graph

Attributes

adj

Graph adjacency object holding the neighbors of each node.

degree

A DegreeView for the Graph as G.degree or G.degree().

edges

An EdgeView of the Graph as G.edges or G.edges().

name

String identifier of the graph.

nodes

A NodeView of the Graph as G.nodes or G.nodes().

seed

The seed for random device parameters variance.

sorted_edges

A list contains all the edges in deterministic order.

sorted_nodes

A list contains all the nodes in deterministic order.