Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

Representing Quantum States using NumPy

P. K. Majumdar

Published Aug 1, 2026• 0 citations
Publisher

Abstract

This example demonstrates 1. Complex vectors 2. Scalar multiplication 3. Vector addition 4. Linear combinations 5. Vector space closure 6. Vector norms 7. State normalisation 8. Inner products 9. Orthogonality
DOI
10.5281/zenodo.21729808

Related papers

Vector spaces

Helmut Bez, Tony Croft

Vector spaces are the mathematical structures in which the state vectors of quantum computation live. When endowed with an inner product, a vector space becomes an inner product space. Of particular relevance are complex inner product spaces. An objective of this chapter is to provide a formal definition of a vector space and give several examples. You will see that, in this context, a ‘vector’ is a much more general object than vectors such as those in https://www.w3.org/1998/Math/MathML" display="inline"> ℝ 2 https://www.w3.org/1999/xlink" xlink:href=" https://s3-euw1-ap-pe-df-pch-content-public-p.s3.eu-west-1.amazonaws.com/9781003264569/7139ce19-0d58-4a0c-820f-b76fb033e438/content/math6_1.tif "/> and https://www.w3.org/1998/Math/MathML" display="inline"> ℝ 3 https://www.w3.org/1999/xlink" xlink:href=" https://s3-euw1-ap-pe-df-pch-content-public-p.s3.eu-west-1.amazonaws.com/9781003264569/7139ce19-0d58-4a0c-820f-b76fb033e438/content/math6_2.tif "/> . However, the already familiar operations of vector addition and scalar multiplication are essential ingredients of all vector spaces. We demonstrate how vectors in a vector space can be constructed using a set of vectors called a basis and see how vectors can be written in terms of different bases. Of particular importance are orthonormal bases in which the basis vectors are mutually orthogonal and normalised. Finally, we introduce cosets and explain how a quotient space is constructed.

Chapman & Hall/CRC eBooks•Jan 6, 2023•0 citations

Orthogonality Check

P. K. Majumdar

This Jupyter Notebook provides a reproducible implementation for determining whether two complex quantum state vectors are orthogonal The notebook accompanies Chapter 2 of Quantum Computing Preliminaries and demonstrates how orthogonality is tested using the absolute value of the complex inner product The Python function accepts normalised or unnormalised state vectors and normalises them automatically before calculating their overlap The implementation validates that both inputs are finite nonempty one dimensional and equal in size It also rejects the zero vector because the zero vector cannot be normalised The calculation uses the NumPy vdot function to apply complex conjugation to the first vector correctly A numerical tolerance is used to determine whether the absolute overlap is sufficiently close to zero The function returns True when the states are orthogonal and False otherwise The notebook includes examples involving the computational zero state the computational one state the plus state and two unnormalised complex vectors The examples confirm that the computational zero and one states are orthogonal while the computational zero and plus states are not orthogonal The unnormalised complex example also demonstrates a pair of states that are not orthogonal Numerical assertions verify all calculated results The notebook requires Python 3 Jupyter Notebook or JupyterLab and NumPy No external datasets internet connection quantum computing framework or physical quantum hardware are required

•Aug 11, 2026•0 citations

States as Vectors

Tilak Sinha

From here, we take up the task of reformulating quantum mechanics in the language of inner product space. We start by introducing vector space through the familiar example of a set of finite dimensional, complex, column matrices under addition and multiplication by scalars. The inner product is then introduced as a dot product generalized to complex vectors leading to the idea of an inner product space . This is adequate to show how the concept of a quantum state can be described by a normalized vector in an inner product space so that the state space can be identified with the inner product space. Amplitudes are associated with inner products , and observables with orthonormal bases in this space. Hence the laws of quantum mechanics are reformulated. We then point out that the now reformulated laws are independent of the space of description and the reader is urged to contemplate an universality which would reflect the independence with respect to the representation space . This creates the stage for the introduction of the abstract inner product space and the formulation of quantum mechanics in this setting. The chapter concludes with this description. The transformed laws are now called postulatesof quantum mechanics .

Chapman & Hall/CRC eBooks•Jun 18, 2021•0 citations

Simulating Quantum Superposition

P. K. Majumdar

This program constructs a linear combination of two normalised quantum state vectors and verifies closure with respect to array shape, dimensionality, size, and complex data type.

•Aug 4, 2026•0 citations

Qubits and Quantum States

David McMahon

This chapter contains sections titled: The Qubit Vector Spaces Linear Combinations of Vectors Uniqueness of a Spanning Set Basis and Dimension Inner Products Orthonormality Gram-Schmidt Orthogonalization Bra-Ket Formalism The Cauchy-Schwartz and Triangle Inequalities Summary Exercises

Wiley eBooks•Mar 23, 2007•1 citation

Constructing and Validating Quantum Projection Operators with NumPy

P. K. Majumdar

This program constructs a projection operator from a normalised complex state vector and verifies its Hermiticity, idempotence, trace and eigenvalues. It also generates the complementary projector, confirms that the two outcome projectors resolve the identity, and calculates measurement probabilities for an example input state. Numerical tolerances are used to accommodate floating-point arithmetic.

•Aug 25, 2026•0 citations
Vector spaces are the mathematical structures in which the state vectors of quantum computation live. When endowed with an inner product, a vector space becomes an inner product space. Of particular relevance are complex inner product spaces. An objective of this chapter is to provide a formal definition of a vector space and give several examples. You will see that, in this context, a ‘vector’ is a much more general object than vectors such as those in https://www.w3.org/1998/Math/MathML" display="inline"> ℝ 2 https://www.w3.org/1999/xlink" xlink:href=" https://s3-euw1-ap-pe-df-pch-content-public-p.s3.eu-west-1.amazonaws.com/9781003264569/7139ce19-0d58-4a0c-820f-b76fb033e438/content/math6_1.tif "/> and https://www.w3.org/1998/Math/MathML" display="inline"> ℝ 3 https://www.w3.org/1999/xlink" xlink:href=" https://s3-euw1-ap-pe-df-pch-content-public-p.s3.eu-west-1.amazonaws.com/9781003264569/7139ce19-0d58-4a0c-820f-b76fb033e438/content/math6_2.tif "/> . However, the already familiar operations of vector addition and scalar multiplication are essential ingredients of all vector spaces. We demonstrate how vectors in a vector space can be constructed using a set of vectors called a basis and see how vectors can be written in terms of different bases. Of particular importance are orthonormal bases in which the basis vectors are mutually orthogonal and normalised. Finally, we introduce cosets and explain how a quotient space is constructed.
This Jupyter Notebook provides a reproducible implementation for determining whether two complex quantum state vectors are orthogonal The notebook accompanies Chapter 2 of Quantum Computing Preliminaries and demonstrates how orthogonality is tested using the absolute value of the complex inner product The Python function accepts normalised or unnormalised state vectors and normalises them automatically before calculating their overlap The implementation validates that both inputs are finite nonempty one dimensional and equal in size It also rejects the zero vector because the zero vector cannot be normalised The calculation uses the NumPy vdot function to apply complex conjugation to the first vector correctly A numerical tolerance is used to determine whether the absolute overlap is sufficiently close to zero The function returns True when the states are orthogonal and False otherwise The notebook includes examples involving the computational zero state the computational one state the plus state and two unnormalised complex vectors The examples confirm that the computational zero and one states are orthogonal while the computational zero and plus states are not orthogonal The unnormalised complex example also demonstrates a pair of states that are not orthogonal Numerical assertions verify all calculated results The notebook requires Python 3 Jupyter Notebook or JupyterLab and NumPy No external datasets internet connection quantum computing framework or physical quantum hardware are required
From here, we take up the task of reformulating quantum mechanics in the language of inner product space. We start by introducing vector space through the familiar example of a set of finite dimensional, complex, column matrices under addition and multiplication by scalars. The inner product is then introduced as a dot product generalized to complex vectors leading to the idea of an inner product space . This is adequate to show how the concept of a quantum state can be described by a normalized vector in an inner product space so that the state space can be identified with the inner product space. Amplitudes are associated with inner products , and observables with orthonormal bases in this space. Hence the laws of quantum mechanics are reformulated. We then point out that the now reformulated laws are independent of the space of description and the reader is urged to contemplate an universality which would reflect the independence with respect to the representation space . This creates the stage for the introduction of the abstract inner product space and the formulation of quantum mechanics in this setting. The chapter concludes with this description. The transformed laws are now called postulatesof quantum mechanics .