{"payload":{"allShortcutsEnabled":false,"fileTree":{"qiskit/quantum_info/states":{"items":[{"name":"__init__.py","path":"qiskit/quantum_info/states/__init__.py","contentType":"file"},{"name":"densitymatrix.py","path":"qiskit/quantum_info/states/densitymatrix.py","contentType":"file"},{"name":"measures.py","path":"qiskit/quantum_info/states/measures.py","contentType":"file"},{"name":"quantum_state.py","path":"qiskit/quantum_info/states/quantum_state.py","contentType":"file"},{"name":"random.py","path":"qiskit/quantum_info/states/random.py","contentType":"file"},{"name":"stabilizerstate.py","path":"qiskit/quantum_info/states/stabilizerstate.py","contentType":"file"},{"name":"statevector.py","path":"qiskit/quantum_info/states/statevector.py","contentType":"file"},{"name":"utils.py","path":"qiskit/quantum_info/states/utils.py","contentType":"file"}],"totalCount":8},"qiskit/quantum_info":{"items":[{"name":"analysis","path":"qiskit/quantum_info/analysis","contentType":"directory"},{"name":"operators","path":"qiskit/quantum_info/operators","contentType":"directory"},{"name":"states","path":"qiskit/quantum_info/states","contentType":"directory"},{"name":"__init__.py","path":"qiskit/quantum_info/__init__.py","contentType":"file"},{"name":"quaternion.py","path":"qiskit/quantum_info/quaternion.py","contentType":"file"},{"name":"random.py","path":"qiskit/quantum_info/random.py","contentType":"file"}],"totalCount":6},"qiskit":{"items":[{"name":"assembler","path":"qiskit/assembler","contentType":"directory"},{"name":"circuit","path":"qiskit/circuit","contentType":"directory"},{"name":"compiler","path":"qiskit/compiler","contentType":"directory"},{"name":"converters","path":"qiskit/converters","contentType":"directory"},{"name":"dagcircuit","path":"qiskit/dagcircuit","contentType":"directory"},{"name":"passmanager","path":"qiskit/passmanager","contentType":"directory"},{"name":"primitives","path":"qiskit/primitives","contentType":"directory"},{"name":"providers","path":"qiskit/providers","contentType":"directory"},{"name":"pulse","path":"qiskit/pulse","contentType":"directory"},{"name":"qasm","path":"qiskit/qasm","contentType":"directory"},{"name":"qasm2","path":"qiskit/qasm2","contentType":"directory"},{"name":"qasm3","path":"qiskit/qasm3","contentType":"directory"},{"name":"qobj","path":"qiskit/qobj","contentType":"directory"},{"name":"qpy","path":"qiskit/qpy","contentType":"directory"},{"name":"quantum_info","path":"qiskit/quantum_info","contentType":"directory"},{"name":"result","path":"qiskit/result","contentType":"directory"},{"name":"scheduler","path":"qiskit/scheduler","contentType":"directory"},{"name":"synthesis","path":"qiskit/synthesis","contentType":"directory"},{"name":"transpiler","path":"qiskit/transpiler","contentType":"directory"},{"name":"utils","path":"qiskit/utils","contentType":"directory"},{"name":"visualization","path":"qiskit/visualization","contentType":"directory"},{"name":"VERSION.txt","path":"qiskit/VERSION.txt","contentType":"file"},{"name":"__init__.py","path":"qiskit/__init__.py","contentType":"file"},{"name":"exceptions.py","path":"qiskit/exceptions.py","contentType":"file"},{"name":"user_config.py","path":"qiskit/user_config.py","contentType":"file"},{"name":"version.py","path":"qiskit/version.py","contentType":"file"}],"totalCount":26},"":{"items":[{"name":".azure","path":".azure","contentType":"directory"},{"name":".binder","path":".binder","contentType":"directory"},{"name":".cargo","path":".cargo","contentType":"directory"},{"name":".github","path":".github","contentType":"directory"},{"name":"crates","path":"crates","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"examples","path":"examples","contentType":"directory"},{"name":"qiskit","path":"qiskit","contentType":"directory"},{"name":"releasenotes","path":"releasenotes","contentType":"directory"},{"name":"test","path":"test","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".editorconfig","path":".editorconfig","contentType":"file"},{"name":".git-blame-ignore-revs","path":".git-blame-ignore-revs","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".local-spellings","path":".local-spellings","contentType":"file"},{"name":".mailmap","path":".mailmap","contentType":"file"},{"name":".mergify.yml","path":".mergify.yml","contentType":"file"},{"name":".stestr.conf","path":".stestr.conf","contentType":"file"},{"name":"CITATION.bib","path":"CITATION.bib","contentType":"file"},{"name":"CODE_OF_CONDUCT.md","path":"CODE_OF_CONDUCT.md","contentType":"file"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","contentType":"file"},{"name":"Cargo.lock","path":"Cargo.lock","contentType":"file"},{"name":"Cargo.toml","path":"Cargo.toml","contentType":"file"},{"name":"DEPRECATION.md","path":"DEPRECATION.md","contentType":"file"},{"name":"LICENSE.txt","path":"LICENSE.txt","contentType":"file"},{"name":"MAINTAINING.md","path":"MAINTAINING.md","contentType":"file"},{"name":"MANIFEST.in","path":"MANIFEST.in","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"SECURITY.md","path":"SECURITY.md","contentType":"file"},{"name":"asv.conf.json","path":"asv.conf.json","contentType":"file"},{"name":"azure-pipelines.yml","path":"azure-pipelines.yml","contentType":"file"},{"name":"constraints.txt","path":"constraints.txt","contentType":"file"},{"name":"pyproject.toml","path":"pyproject.toml","contentType":"file"},{"name":"qiskit_bot.yaml","path":"qiskit_bot.yaml","contentType":"file"},{"name":"requirements-dev.txt","path":"requirements-dev.txt","contentType":"file"},{"name":"requirements-optional.txt","path":"requirements-optional.txt","contentType":"file"},{"name":"requirements.txt","path":"requirements.txt","contentType":"file"},{"name":"rust-toolchain.toml","path":"rust-toolchain.toml","contentType":"file"},{"name":"setup.py","path":"setup.py","contentType":"file"},{"name":"tox.ini","path":"tox.ini","contentType":"file"}],"totalCount":41}},"fileTreeProcessingTime":14.857319,"foldersToFetch":[],"repo":{"id":83821669,"defaultBranch":"main","name":"qiskit","ownerLogin":"Qiskit","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2017-03-03T17:02:42.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/30696987?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"main","listCacheKey":"v0:1710785011.0","canEdit":false,"refType":"branch","currentOid":"43381ae1b159c01b55159d2dc1e8a65970b72746"},"path":"qiskit/quantum_info/states/random.py","currentUser":null,"blob":{"rawLines":["# This code is part of Qiskit.","#","# (C) Copyright IBM 2017, 2019.","#","# This code is licensed under the Apache License, Version 2.0. You may","# obtain a copy of this license in the LICENSE.txt file in the root directory","# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.","#","# Any modifications or derivative works of this code must retain this","# copyright notice, and modified files need to carry a notice indicating","# that they have been altered from the originals.","","\"\"\"","Random state generation.","\"\"\"","","from __future__ import annotations","from typing import Literal","","import numpy as np","from numpy.random import default_rng","","from qiskit.exceptions import QiskitError","from qiskit.quantum_info.operators.random import random_unitary","from .statevector import Statevector","from .densitymatrix import DensityMatrix","","","def random_statevector("," dims: int | tuple, seed: int | np.random.Generator | None = None",") -> Statevector:"," \"\"\"Generator a random Statevector.",""," The statevector is sampled from the uniform distribution. This is the measure"," induced by the Haar measure on unitary matrices.",""," Args:"," dims (int or tuple): the dimensions of the state."," seed (int or np.random.Generator): Optional. Set a fixed seed or"," generator for RNG.",""," Returns:"," Statevector: the random statevector.",""," Reference:"," K. Zyczkowski and H. Sommers (2001), \"Induced measures in the space of mixed quantum states\","," `J. Phys. A: Math. Gen. 34 7111 `__."," \"\"\""," if seed is None:"," rng = np.random.default_rng()"," elif isinstance(seed, np.random.Generator):"," rng = seed"," else:"," rng = default_rng(seed)",""," dim = np.prod(dims)"," vec = rng.standard_normal(dim).astype(complex)"," vec += 1j * rng.standard_normal(dim)"," vec /= np.linalg.norm(vec)"," return Statevector(vec, dims=dims)","","","def random_density_matrix("," dims: int | tuple,"," rank: int | None = None,"," method: Literal[\"Hilbert-Schmidt\", \"Bures\"] = \"Hilbert-Schmidt\","," seed: int | np.random.Generator | None = None,",") -> DensityMatrix:"," \"\"\"Generator a random DensityMatrix.",""," Args:"," dims (int or tuple): the dimensions of the DensityMatrix."," rank (int or None): Optional, the rank of the density matrix."," The default value is full-rank."," method (string): Optional. The method to use."," 'Hilbert-Schmidt': (Default) sample from the Hilbert-Schmidt metric."," 'Bures': sample from the Bures metric."," seed (int or np.random.Generator): Optional. Set a fixed seed or"," generator for RNG.",""," Returns:"," DensityMatrix: the random density matrix.",""," Raises:"," QiskitError: if the method is not valid."," \"\"\""," # Flatten dimensions"," dim = np.prod(dims)"," if rank is None:"," rank = dim # Use full rank",""," if method == \"Hilbert-Schmidt\":"," rho = _random_density_hs(dim, rank, seed)"," elif method == \"Bures\":"," rho = _random_density_bures(dim, rank, seed)"," else:"," raise QiskitError(f\"Error: unrecognized method {method}\")"," return DensityMatrix(rho, dims=dims)","","","def _ginibre_matrix(nrow, ncol, seed):"," \"\"\"Return a normally distributed complex random matrix.",""," Args:"," nrow (int): number of rows in output matrix."," ncol (int): number of columns in output matrix."," seed(int or np.random.Generator): default rng.",""," Returns:"," ndarray: A complex rectangular matrix where each real and imaginary"," entry is sampled from the normal distribution."," \"\"\""," if seed is None:"," rng = np.random.default_rng()"," elif isinstance(seed, np.random.Generator):"," rng = seed"," else:"," rng = default_rng(seed)",""," ginibre = rng.normal(size=(nrow, ncol)) + rng.normal(size=(nrow, ncol)) * 1j"," return ginibre","","","def _random_density_hs(dim, rank, seed):"," \"\"\""," Generate a random density matrix from the Hilbert-Schmidt metric.",""," Args:"," dim (int): the dimensions of the density matrix."," rank (int or None): the rank of the density matrix. The default"," value is full-rank."," seed (int or np.random.Generator): default rng.",""," Returns:"," ndarray: rho (N,N) a density matrix."," \"\"\""," mat = _ginibre_matrix(dim, rank, seed)"," mat = mat.dot(mat.conj().T)"," return mat / np.trace(mat)","","","def _random_density_bures(dim, rank, seed):"," \"\"\"Generate a random density matrix from the Bures metric.",""," Args:"," dim (int): the length of the density matrix."," rank (int or None): the rank of the density matrix. The default"," value is full-rank."," seed (int or np.random.Generator): default rng.",""," Returns:"," ndarray: rho (N,N) a density matrix."," \"\"\""," density = np.eye(dim) + random_unitary(dim, seed=seed).data"," mat = density.dot(_ginibre_matrix(dim, rank, seed))"," mat = mat.dot(mat.conj().T)"," return mat / np.trace(mat)"],"stylingDirectives":[[{"start":0,"end":30,"cssClass":"pl-c"}],[{"start":0,"end":1,"cssClass":"pl-c"}],[{"start":0,"end":31,"cssClass":"pl-c"}],[{"start":0,"end":1,"cssClass":"pl-c"}],[{"start":0,"end":70,"cssClass":"pl-c"}],[{"start":0,"end":77,"cssClass":"pl-c"}],[{"start":0,"end":71,"cssClass":"pl-c"}],[{"start":0,"end":1,"cssClass":"pl-c"}],[{"start":0,"end":69,"cssClass":"pl-c"}],[{"start":0,"end":72,"cssClass":"pl-c"}],[{"start":0,"end":49,"cssClass":"pl-c"}],[],[{"start":0,"end":3,"cssClass":"pl-s"}],[{"start":0,"end":24,"cssClass":"pl-s"}],[{"start":0,"end":3,"cssClass":"pl-s"}],[],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":16,"end":22,"cssClass":"pl-k"},{"start":23,"end":34,"cssClass":"pl-s1"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":11,"cssClass":"pl-s1"},{"start":12,"end":18,"cssClass":"pl-k"},{"start":19,"end":26,"cssClass":"pl-v"}],[],[{"start":0,"end":6,"cssClass":"pl-k"},{"start":7,"end":12,"cssClass":"pl-s1"},{"start":13,"end":15,"cssClass":"pl-k"},{"start":16,"end":18,"cssClass":"pl-s1"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":10,"cssClass":"pl-s1"},{"start":11,"end":17,"cssClass":"pl-s1"},{"start":18,"end":24,"cssClass":"pl-k"},{"start":25,"end":36,"cssClass":"pl-s1"}],[],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":11,"cssClass":"pl-s1"},{"start":12,"end":22,"cssClass":"pl-s1"},{"start":23,"end":29,"cssClass":"pl-k"},{"start":30,"end":41,"cssClass":"pl-v"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":5,"end":11,"cssClass":"pl-s1"},{"start":12,"end":24,"cssClass":"pl-s1"},{"start":25,"end":34,"cssClass":"pl-s1"},{"start":35,"end":41,"cssClass":"pl-s1"},{"start":42,"end":48,"cssClass":"pl-k"},{"start":49,"end":63,"cssClass":"pl-s1"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":6,"end":17,"cssClass":"pl-s1"},{"start":18,"end":24,"cssClass":"pl-k"},{"start":25,"end":36,"cssClass":"pl-v"}],[{"start":0,"end":4,"cssClass":"pl-k"},{"start":6,"end":19,"cssClass":"pl-s1"},{"start":20,"end":26,"cssClass":"pl-k"},{"start":27,"end":40,"cssClass":"pl-v"}],[],[],[{"start":0,"end":3,"cssClass":"pl-k"},{"start":4,"end":22,"cssClass":"pl-en"}],[{"start":4,"end":8,"cssClass":"pl-s1"},{"start":10,"end":13,"cssClass":"pl-s1"},{"start":14,"end":15,"cssClass":"pl-c1"},{"start":16,"end":21,"cssClass":"pl-s1"},{"start":23,"end":27,"cssClass":"pl-s1"},{"start":29,"end":32,"cssClass":"pl-s1"},{"start":33,"end":34,"cssClass":"pl-c1"},{"start":35,"end":37,"cssClass":"pl-s1"},{"start":38,"end":44,"cssClass":"pl-s1"},{"start":45,"end":54,"cssClass":"pl-v"},{"start":55,"end":56,"cssClass":"pl-c1"},{"start":57,"end":61,"cssClass":"pl-c1"},{"start":62,"end":63,"cssClass":"pl-c1"},{"start":64,"end":68,"cssClass":"pl-c1"}],[{"start":2,"end":4,"cssClass":"pl-c1"},{"start":5,"end":16,"cssClass":"pl-v"}],[{"start":4,"end":38,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":81,"cssClass":"pl-s"}],[{"start":0,"end":52,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":9,"cssClass":"pl-s"}],[{"start":0,"end":57,"cssClass":"pl-s"}],[{"start":0,"end":72,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":12,"cssClass":"pl-s"}],[{"start":0,"end":44,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":14,"cssClass":"pl-s"}],[{"start":0,"end":101,"cssClass":"pl-s"}],[{"start":0,"end":84,"cssClass":"pl-s"}],[{"start":0,"end":7,"cssClass":"pl-s"}],[{"start":4,"end":6,"cssClass":"pl-k"},{"start":7,"end":11,"cssClass":"pl-s1"},{"start":12,"end":14,"cssClass":"pl-c1"},{"start":15,"end":19,"cssClass":"pl-c1"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":16,"cssClass":"pl-s1"},{"start":17,"end":23,"cssClass":"pl-s1"},{"start":24,"end":35,"cssClass":"pl-en"}],[{"start":4,"end":8,"cssClass":"pl-k"},{"start":9,"end":19,"cssClass":"pl-en"},{"start":20,"end":24,"cssClass":"pl-s1"},{"start":26,"end":28,"cssClass":"pl-s1"},{"start":29,"end":35,"cssClass":"pl-s1"},{"start":36,"end":45,"cssClass":"pl-v"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-s1"}],[{"start":4,"end":8,"cssClass":"pl-k"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":25,"cssClass":"pl-en"},{"start":26,"end":30,"cssClass":"pl-s1"}],[],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":9,"cssClass":"pl-c1"},{"start":10,"end":12,"cssClass":"pl-s1"},{"start":13,"end":17,"cssClass":"pl-en"},{"start":18,"end":22,"cssClass":"pl-s1"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":9,"cssClass":"pl-c1"},{"start":10,"end":13,"cssClass":"pl-s1"},{"start":14,"end":29,"cssClass":"pl-en"},{"start":30,"end":33,"cssClass":"pl-s1"},{"start":35,"end":41,"cssClass":"pl-en"},{"start":42,"end":49,"cssClass":"pl-s1"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":10,"cssClass":"pl-c1"},{"start":11,"end":13,"cssClass":"pl-c1"},{"start":14,"end":15,"cssClass":"pl-c1"},{"start":16,"end":19,"cssClass":"pl-s1"},{"start":20,"end":35,"cssClass":"pl-en"},{"start":36,"end":39,"cssClass":"pl-s1"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":10,"cssClass":"pl-c1"},{"start":11,"end":13,"cssClass":"pl-s1"},{"start":14,"end":20,"cssClass":"pl-s1"},{"start":21,"end":25,"cssClass":"pl-en"},{"start":26,"end":29,"cssClass":"pl-s1"}],[{"start":4,"end":10,"cssClass":"pl-k"},{"start":11,"end":22,"cssClass":"pl-v"},{"start":23,"end":26,"cssClass":"pl-s1"},{"start":28,"end":32,"cssClass":"pl-s1"},{"start":32,"end":33,"cssClass":"pl-c1"},{"start":33,"end":37,"cssClass":"pl-s1"}],[],[],[{"start":0,"end":3,"cssClass":"pl-k"},{"start":4,"end":25,"cssClass":"pl-en"}],[{"start":4,"end":8,"cssClass":"pl-s1"},{"start":10,"end":13,"cssClass":"pl-s1"},{"start":14,"end":15,"cssClass":"pl-c1"},{"start":16,"end":21,"cssClass":"pl-s1"}],[{"start":4,"end":8,"cssClass":"pl-s1"},{"start":10,"end":13,"cssClass":"pl-s1"},{"start":14,"end":15,"cssClass":"pl-c1"},{"start":16,"end":20,"cssClass":"pl-c1"},{"start":21,"end":22,"cssClass":"pl-c1"},{"start":23,"end":27,"cssClass":"pl-c1"}],[{"start":4,"end":10,"cssClass":"pl-s1"},{"start":12,"end":19,"cssClass":"pl-v"},{"start":20,"end":37,"cssClass":"pl-s"},{"start":39,"end":46,"cssClass":"pl-s"},{"start":48,"end":49,"cssClass":"pl-c1"},{"start":50,"end":67,"cssClass":"pl-s"}],[{"start":4,"end":8,"cssClass":"pl-s1"},{"start":10,"end":13,"cssClass":"pl-s1"},{"start":14,"end":15,"cssClass":"pl-c1"},{"start":16,"end":18,"cssClass":"pl-s1"},{"start":19,"end":25,"cssClass":"pl-s1"},{"start":26,"end":35,"cssClass":"pl-v"},{"start":36,"end":37,"cssClass":"pl-c1"},{"start":38,"end":42,"cssClass":"pl-c1"},{"start":43,"end":44,"cssClass":"pl-c1"},{"start":45,"end":49,"cssClass":"pl-c1"}],[{"start":2,"end":4,"cssClass":"pl-c1"},{"start":5,"end":18,"cssClass":"pl-v"}],[{"start":4,"end":40,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":9,"cssClass":"pl-s"}],[{"start":0,"end":65,"cssClass":"pl-s"}],[{"start":0,"end":69,"cssClass":"pl-s"}],[{"start":0,"end":59,"cssClass":"pl-s"}],[{"start":0,"end":53,"cssClass":"pl-s"}],[{"start":0,"end":80,"cssClass":"pl-s"}],[{"start":0,"end":50,"cssClass":"pl-s"}],[{"start":0,"end":72,"cssClass":"pl-s"}],[{"start":0,"end":61,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":12,"cssClass":"pl-s"}],[{"start":0,"end":49,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":11,"cssClass":"pl-s"}],[{"start":0,"end":48,"cssClass":"pl-s"}],[{"start":0,"end":7,"cssClass":"pl-s"}],[{"start":4,"end":24,"cssClass":"pl-c"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":9,"cssClass":"pl-c1"},{"start":10,"end":12,"cssClass":"pl-s1"},{"start":13,"end":17,"cssClass":"pl-en"},{"start":18,"end":22,"cssClass":"pl-s1"}],[{"start":4,"end":6,"cssClass":"pl-k"},{"start":7,"end":11,"cssClass":"pl-s1"},{"start":12,"end":14,"cssClass":"pl-c1"},{"start":15,"end":19,"cssClass":"pl-c1"}],[{"start":8,"end":12,"cssClass":"pl-s1"},{"start":13,"end":14,"cssClass":"pl-c1"},{"start":15,"end":18,"cssClass":"pl-s1"},{"start":20,"end":35,"cssClass":"pl-c"}],[],[{"start":4,"end":6,"cssClass":"pl-k"},{"start":7,"end":13,"cssClass":"pl-s1"},{"start":14,"end":16,"cssClass":"pl-c1"},{"start":17,"end":34,"cssClass":"pl-s"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":32,"cssClass":"pl-en"},{"start":33,"end":36,"cssClass":"pl-s1"},{"start":38,"end":42,"cssClass":"pl-s1"},{"start":44,"end":48,"cssClass":"pl-s1"}],[{"start":4,"end":8,"cssClass":"pl-k"},{"start":9,"end":15,"cssClass":"pl-s1"},{"start":16,"end":18,"cssClass":"pl-c1"},{"start":19,"end":26,"cssClass":"pl-s"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":35,"cssClass":"pl-en"},{"start":36,"end":39,"cssClass":"pl-s1"},{"start":41,"end":45,"cssClass":"pl-s1"},{"start":47,"end":51,"cssClass":"pl-s1"}],[{"start":4,"end":8,"cssClass":"pl-k"}],[{"start":8,"end":13,"cssClass":"pl-k"},{"start":14,"end":25,"cssClass":"pl-v"},{"start":26,"end":64,"cssClass":"pl-s"},{"start":55,"end":63,"cssClass":"pl-s1"},{"start":55,"end":56,"cssClass":"pl-kos"},{"start":56,"end":62,"cssClass":"pl-s1"},{"start":62,"end":63,"cssClass":"pl-kos"}],[{"start":4,"end":10,"cssClass":"pl-k"},{"start":11,"end":24,"cssClass":"pl-v"},{"start":25,"end":28,"cssClass":"pl-s1"},{"start":30,"end":34,"cssClass":"pl-s1"},{"start":34,"end":35,"cssClass":"pl-c1"},{"start":35,"end":39,"cssClass":"pl-s1"}],[],[],[{"start":0,"end":3,"cssClass":"pl-k"},{"start":4,"end":19,"cssClass":"pl-en"},{"start":20,"end":24,"cssClass":"pl-s1"},{"start":26,"end":30,"cssClass":"pl-s1"},{"start":32,"end":36,"cssClass":"pl-s1"}],[{"start":4,"end":59,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":9,"cssClass":"pl-s"}],[{"start":0,"end":52,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":54,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":12,"cssClass":"pl-s"}],[{"start":0,"end":75,"cssClass":"pl-s"}],[{"start":0,"end":58,"cssClass":"pl-s"}],[{"start":0,"end":7,"cssClass":"pl-s"}],[{"start":4,"end":6,"cssClass":"pl-k"},{"start":7,"end":11,"cssClass":"pl-s1"},{"start":12,"end":14,"cssClass":"pl-c1"},{"start":15,"end":19,"cssClass":"pl-c1"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":16,"cssClass":"pl-s1"},{"start":17,"end":23,"cssClass":"pl-s1"},{"start":24,"end":35,"cssClass":"pl-en"}],[{"start":4,"end":8,"cssClass":"pl-k"},{"start":9,"end":19,"cssClass":"pl-en"},{"start":20,"end":24,"cssClass":"pl-s1"},{"start":26,"end":28,"cssClass":"pl-s1"},{"start":29,"end":35,"cssClass":"pl-s1"},{"start":36,"end":45,"cssClass":"pl-v"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":18,"cssClass":"pl-s1"}],[{"start":4,"end":8,"cssClass":"pl-k"}],[{"start":8,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":25,"cssClass":"pl-en"},{"start":26,"end":30,"cssClass":"pl-s1"}],[],[{"start":4,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":17,"cssClass":"pl-s1"},{"start":18,"end":24,"cssClass":"pl-en"},{"start":25,"end":29,"cssClass":"pl-s1"},{"start":29,"end":30,"cssClass":"pl-c1"},{"start":31,"end":35,"cssClass":"pl-s1"},{"start":37,"end":41,"cssClass":"pl-s1"},{"start":44,"end":45,"cssClass":"pl-c1"},{"start":46,"end":49,"cssClass":"pl-s1"},{"start":50,"end":56,"cssClass":"pl-en"},{"start":57,"end":61,"cssClass":"pl-s1"},{"start":61,"end":62,"cssClass":"pl-c1"},{"start":63,"end":67,"cssClass":"pl-s1"},{"start":69,"end":73,"cssClass":"pl-s1"},{"start":76,"end":77,"cssClass":"pl-c1"},{"start":78,"end":80,"cssClass":"pl-c1"}],[{"start":4,"end":10,"cssClass":"pl-k"},{"start":11,"end":18,"cssClass":"pl-s1"}],[],[],[{"start":0,"end":3,"cssClass":"pl-k"},{"start":4,"end":22,"cssClass":"pl-en"},{"start":23,"end":26,"cssClass":"pl-s1"},{"start":28,"end":32,"cssClass":"pl-s1"},{"start":34,"end":38,"cssClass":"pl-s1"}],[{"start":4,"end":7,"cssClass":"pl-s"}],[{"start":0,"end":69,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":9,"cssClass":"pl-s"}],[{"start":0,"end":56,"cssClass":"pl-s"}],[{"start":0,"end":71,"cssClass":"pl-s"}],[{"start":0,"end":31,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":12,"cssClass":"pl-s"}],[{"start":0,"end":45,"cssClass":"pl-s"}],[{"start":0,"end":7,"cssClass":"pl-s"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":9,"cssClass":"pl-c1"},{"start":10,"end":25,"cssClass":"pl-en"},{"start":26,"end":29,"cssClass":"pl-s1"},{"start":31,"end":35,"cssClass":"pl-s1"},{"start":37,"end":41,"cssClass":"pl-s1"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":9,"cssClass":"pl-c1"},{"start":10,"end":13,"cssClass":"pl-s1"},{"start":14,"end":17,"cssClass":"pl-en"},{"start":18,"end":21,"cssClass":"pl-s1"},{"start":22,"end":26,"cssClass":"pl-en"},{"start":29,"end":30,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-k"},{"start":11,"end":14,"cssClass":"pl-s1"},{"start":15,"end":16,"cssClass":"pl-c1"},{"start":17,"end":19,"cssClass":"pl-s1"},{"start":20,"end":25,"cssClass":"pl-en"},{"start":26,"end":29,"cssClass":"pl-s1"}],[],[],[{"start":0,"end":3,"cssClass":"pl-k"},{"start":4,"end":25,"cssClass":"pl-en"},{"start":26,"end":29,"cssClass":"pl-s1"},{"start":31,"end":35,"cssClass":"pl-s1"},{"start":37,"end":41,"cssClass":"pl-s1"}],[{"start":4,"end":62,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":9,"cssClass":"pl-s"}],[{"start":0,"end":52,"cssClass":"pl-s"}],[{"start":0,"end":71,"cssClass":"pl-s"}],[{"start":0,"end":31,"cssClass":"pl-s"}],[{"start":0,"end":55,"cssClass":"pl-s"}],[{"start":0,"end":0,"cssClass":"pl-s"}],[{"start":0,"end":12,"cssClass":"pl-s"}],[{"start":0,"end":44,"cssClass":"pl-s"}],[{"start":0,"end":7,"cssClass":"pl-s"}],[{"start":4,"end":11,"cssClass":"pl-s1"},{"start":12,"end":13,"cssClass":"pl-c1"},{"start":14,"end":16,"cssClass":"pl-s1"},{"start":17,"end":20,"cssClass":"pl-en"},{"start":21,"end":24,"cssClass":"pl-s1"},{"start":26,"end":27,"cssClass":"pl-c1"},{"start":28,"end":42,"cssClass":"pl-en"},{"start":43,"end":46,"cssClass":"pl-s1"},{"start":48,"end":52,"cssClass":"pl-s1"},{"start":52,"end":53,"cssClass":"pl-c1"},{"start":53,"end":57,"cssClass":"pl-s1"},{"start":59,"end":63,"cssClass":"pl-s1"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":9,"cssClass":"pl-c1"},{"start":10,"end":17,"cssClass":"pl-s1"},{"start":18,"end":21,"cssClass":"pl-en"},{"start":22,"end":37,"cssClass":"pl-en"},{"start":38,"end":41,"cssClass":"pl-s1"},{"start":43,"end":47,"cssClass":"pl-s1"},{"start":49,"end":53,"cssClass":"pl-s1"}],[{"start":4,"end":7,"cssClass":"pl-s1"},{"start":8,"end":9,"cssClass":"pl-c1"},{"start":10,"end":13,"cssClass":"pl-s1"},{"start":14,"end":17,"cssClass":"pl-en"},{"start":18,"end":21,"cssClass":"pl-s1"},{"start":22,"end":26,"cssClass":"pl-en"},{"start":29,"end":30,"cssClass":"pl-v"}],[{"start":4,"end":10,"cssClass":"pl-k"},{"start":11,"end":14,"cssClass":"pl-s1"},{"start":15,"end":16,"cssClass":"pl-c1"},{"start":17,"end":19,"cssClass":"pl-s1"},{"start":20,"end":25,"cssClass":"pl-en"},{"start":26,"end":29,"cssClass":"pl-s1"}]],"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/Qiskit/qiskit/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"random.py","displayUrl":"https://github.com/Qiskit/qiskit/blob/main/qiskit/quantum_info/states/random.py?raw=true","headerInfo":{"blobSize":"4.94 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"76dbd4e","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FQiskit%2Fqiskit%2Fblob%2Fmain%2Fqiskit%2Fquantum_info%2Fstates%2Frandom.py","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"157","truncatedSloc":"127"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Python","languageID":303,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/Qiskit/qiskit/blob/main/qiskit/quantum_info/states/random.py","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/Qiskit/qiskit/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/Qiskit/qiskit/raw/main/qiskit/quantum_info/states/random.py","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":4,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"random_statevector","kind":"function","ident_start":828,"ident_end":846,"extent_start":824,"extent_end":1938,"fully_qualified_name":"random_statevector","ident_utf16":{"start":{"line_number":28,"utf16_col":4},"end":{"line_number":28,"utf16_col":22}},"extent_utf16":{"start":{"line_number":28,"utf16_col":0},"end":{"line_number":59,"utf16_col":38}}},{"name":"random_density_matrix","kind":"function","ident_start":1945,"ident_end":1966,"extent_start":1941,"extent_end":3253,"fully_qualified_name":"random_density_matrix","ident_utf16":{"start":{"line_number":62,"utf16_col":4},"end":{"line_number":62,"utf16_col":25}},"extent_utf16":{"start":{"line_number":62,"utf16_col":0},"end":{"line_number":97,"utf16_col":40}}},{"name":"_ginibre_matrix","kind":"function","ident_start":3260,"ident_end":3275,"extent_start":3256,"extent_end":3955,"fully_qualified_name":"_ginibre_matrix","ident_utf16":{"start":{"line_number":100,"utf16_col":4},"end":{"line_number":100,"utf16_col":19}},"extent_utf16":{"start":{"line_number":100,"utf16_col":0},"end":{"line_number":120,"utf16_col":18}}},{"name":"_random_density_hs","kind":"function","ident_start":3962,"ident_end":3980,"extent_start":3958,"extent_end":4478,"fully_qualified_name":"_random_density_hs","ident_utf16":{"start":{"line_number":123,"utf16_col":4},"end":{"line_number":123,"utf16_col":22}},"extent_utf16":{"start":{"line_number":123,"utf16_col":0},"end":{"line_number":138,"utf16_col":30}}},{"name":"_random_density_bures","kind":"function","ident_start":4485,"ident_end":4506,"extent_start":4481,"extent_end":5061,"fully_qualified_name":"_random_density_bures","ident_utf16":{"start":{"line_number":141,"utf16_col":4},"end":{"line_number":141,"utf16_col":25}},"extent_utf16":{"start":{"line_number":141,"utf16_col":0},"end":{"line_number":156,"utf16_col":30}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/Qiskit/qiskit/branches":{"post":"MIepqD87MqjzueP6ep43M9j9ZzdelWQjySo-foOlP8z0js5jTzhbazWDCDXgPOWfADHCItzuWeN9NvUFvVhYQA"},"/repos/preferences":{"post":"yAXYamG0Ty3uuMK5NOVdouRlu-Ls6kONCozpEMknQeJVAiSDfw07iAW6mvI6F6Slku1u7Cw3deqDwX99x1OyYg"}}},"title":"qiskit/qiskit/quantum_info/states/random.py at main ยท Qiskit/qiskit"}