def snapshot(self,<EOL>label,<EOL>snapshot_type='<STR_LIT>',<EOL>qubits=None,<EOL>params=None):
<EOL>if not isinstance(label, str):<EOL><INDENT>warnings.warn(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>", DeprecationWarning)<EOL>label = str(label)<EOL><DEDENT>if isinstance(qubits, QuantumRegister):<EOL><INDENT>qubits = qubits[:]<EOL><DEDENT>if not qubits:<EOL><INDENT>tuples = []<EOL>if isinstance(self, QuantumCircuit):<EOL><INDENT>for register in self.qregs:<EOL><INDENT>tuples.append(register)<EOL><DEDENT><DEDENT>if not tuples:<EOL><INDENT>raise ExtensionError('<STR_LIT>')<EOL><DEDENT>qubits = []<EOL>for tuple_element in tuples:<EOL><INDENT>if isinstance(tuple_element, QuantumRegister):<EOL><INDENT>for j in range(tuple_element.size):<EOL><INDENT>qubits.append((tuple_element, j))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>qubits.append(tuple_element)<EOL><DEDENT><DEDENT><DEDENT>return self.append(<EOL>Snapshot(<EOL>label,<EOL>snapshot_type=snapshot_type,<EOL>num_qubits=len(qubits),<EOL>params=params), qubits)<EOL>
Take a statevector snapshot of the internal simulator representation.
    Works on all qubits, and prevents reordering (like barrier).

    For other types of snapshots use the Snapshot extension directly.

    Args:
        label (str): a snapshot label to report the result
        snapshot_type (str): the type of the snapshot.
        qubits (list or None): the qubits to apply snapshot to [Default: None].
        params (list or None): the parameters for snapshot_type [Default: None].

    Returns:
        QuantumCircuit: with attached command

    Raises:
        ExtensionError: malformed command