Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5e4bbdf
Committing changes before merge:q
sudhindu Feb 24, 2024
299d70e
linear_algebra/matrices: added transposition subpackage
sudhindu Feb 24, 2024
1acd733
linear_algebra.matrices: added identity.py
sudhindu Feb 24, 2024
d245d4e
quantum.algebra: no_cloning and adjoint_binary_distribution theorem a…
sudhindu Feb 24, 2024
11d34e7
linear_algebra.matrices: update imports
sudhindu Feb 24, 2024
0cda770
linear_algebra : added Adj.distribution method
sudhindu Mar 16, 2024
04f7e47
Merge branch 'master' of https://github.com/sandialabs/Prove-It into …
sudhindu Mar 16, 2024
3bf6e9a
changes according to issue 313
sudhindu May 1, 2024
54ba27f
update in inner_product_spaces.py
sudhindu Jul 16, 2024
09ef437
Update an InnerProdSpaces method
wdcraft01 Jul 24, 2024
4c36f8f
Update some quantum/algebra/demos assumptions
wdcraft01 Jul 26, 2024
aa2733f
Clean up proof of quantum/algebra qmult_of_bra_as_map thm
wdcraft01 Jul 26, 2024
a457184
Update InnerProdSpaces.yield_readily... method
wdcraft01 Jul 27, 2024
9ba53e2
Establish proof of linear_algebra/inner_products/inner_prod_field_mem…
wdcraft01 Aug 3, 2024
3f0fe9c
Establish proof of linear_algebra/inner_products/inner_prod_complex_m…
wdcraft01 Aug 3, 2024
388d0ad
Incremental upgrades to linear_algebra/inner_products/inner_prod_spac…
wdcraft01 Aug 3, 2024
f6f494a
Incremental upgrades to linear_algebra/inner_products/inner_prod.py
wdcraft01 Aug 3, 2024
55e2ddf
Update descriptive/explanatory comments in linear_algebra/matrices/id…
wdcraft01 Aug 3, 2024
25c78c1
Augment descriptive comments in linear_algebra/matrices/transposition…
wdcraft01 Aug 3, 2024
c415971
Incremental augmentation of demos nb in linear_algebra/inner_products
wdcraft01 Aug 3, 2024
a390a1b
Incremental update of demos nb in linear_algebra/matrices/transposition
wdcraft01 Aug 3, 2024
3da7457
Augment and clean up demos nb in linear_algebra/matrices
wdcraft01 Aug 3, 2024
b03a1d6
Update inner_prod_space_def axiom to include vector domain
wdcraft01 Aug 5, 2024
efb1428
Update InnerProdSpaces.yield_readily_provable_inner_prod_spaces() method
wdcraft01 Aug 8, 2024
fc3ebdb
Update InnerProd.deduce_membership() method
wdcraft01 Aug 8, 2024
50685e2
Update demonstrations notebook for linear_algebra/inner_products package
wdcraft01 Aug 8, 2024
d891e37
Prove three simple theorems in linear_algebra/inner_products package
wdcraft01 Aug 8, 2024
cec4806
Update thm_proof.ipynb
sudhindu Aug 12, 2024
8852551
physics/quantum/algebra: update no_cloning theorem
wdcraft01 Aug 22, 2024
e0ad921
updated_from_HOS_branch
sudhindu Aug 31, 2024
e9f1a00
commit
sudhindu Dec 20, 2024
adb41e8
Merge pull request #1 from sudhindu/313-quantum_algebra_development
sudhindu Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import itertools
import re
import time
import lxml # Comment in for Python 3
from lxml import etree # Comment in for Python 3
#import lxml # Comment in for Python 3
#from lxml import etree # Comment in for Python 3
import shutil
import argparse
import nbformat
Expand All @@ -23,8 +23,8 @@
import base64
import datetime
import tarfile
# import urllib#Comment out for Python 3
import urllib.request # Comment in for Python 3
import urllib#Comment out for Python 3
#import urllib.request # Comment in for Python 3
import zmq # to catch ZMQError which randomly occurs when starting a Jupyter kernel
import proveit
from proveit import Theory
Expand Down
6 changes: 3 additions & 3 deletions build_alt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
import argparse
import nbformat
from nbconvert.preprocessors import Preprocessor, ExecutePreprocessor
#from nbconvert.preprocessors.execute import executenb
from nbconvert.preprocessors.execute import executenb
from nbconvert import HTMLExporter
import IPython
from IPython.lib.latextools import LaTeXTool
import base64
import datetime
import tarfile
# import urllib#Comment out for Python 3
import urllib.request # Comment in for Python 3
import urllib#Comment out for Python 3
#import urllib.request # Comment in for Python 3
import zmq # to catch ZMQError which randomly occurs when starting a Jupyter kernel
import proveit
from proveit import Theory
Expand Down
13 changes: 10 additions & 3 deletions packages/proveit/linear_algebra/_theory_nbs_/theorems.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"# Prepare this notebook for defining the theorems of a theory:\n",
"%theorems_notebook # Keep this at the top following 'import proveit'.\n",
"\n",
"from proveit import n\n",
"from proveit import n, K,H\n",
"from proveit.logic import Forall, InSet, CartExp, InClass\n",
"from proveit.numbers import NaturalPos, Rational, Real, Complex\n",
"from proveit.linear_algebra import VecSpaces"
"from proveit.linear_algebra import VecSpaces,InnerProdSpaces"
]
},
{
Expand Down Expand Up @@ -51,6 +51,13 @@
" domain = NaturalPos)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -119,7 +126,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
" (K, H), Equals(\n",
" InClass(H, InnerProdSpaces(K)),\n",
" And(InClass(H, VecSpaces(K)),\n",
" Forall((x, y), InSet(InnerProd(x, y), K)))))"
" Forall((x, y), InSet(InnerProd(x, y), K), domain=H))))"
]
},
{
Expand Down Expand Up @@ -157,7 +157,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"outputs": [],
"source": [
"import proveit\n",
"from proveit import defaults\n",
"from proveit.numbers import Complex, NaturalPos, Real\n",
"from proveit.linear_algebra import InnerProdSpaces, HilbertSpaces, InnerProd\n",
"from proveit import n, v, w, x, y, K, H, U, V\n",
"from proveit.linear_algebra.inner_products import inner_prod_field_membership, inner_prod_complex_membership\n",
"from proveit.logic import CartExp, InClass, InSet\n",
"%begin demonstrations"
]
},
Expand All @@ -23,7 +29,200 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"defaults.assumptions=[InClass(U,HilbertSpaces),\n",
" InClass(V, InnerProdSpaces(K)), InClass(H, HilbertSpaces),\n",
" InSet(v, V), InSet(w, V), InSet(x, H), InSet(y, H)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Testing the instantiation of some theorems underlying important `InnerProd` methods."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"inner_prod_field_membership.instantiate({H:V,x:v,y:w})"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"inner_prod_complex_membership.instantiate({H:H,x:x,y:y})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Testing some `InnerProd` and `InnerProdSpaces` methods and related `VecSpaces` methods."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Some new default assumptions:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"defaults.assumptions = [\n",
" InSet(n, NaturalPos), InSet(v, CartExp(Complex, n)), InSet(w, CartExp(Complex, n)),\n",
" InSet(x, CartExp(Real, n)), InSet(y, CartExp(Real, n))]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Notice that we can deduce that the Cartesian products $C^{n}$ and $R^{n}$ are contained in the appropriate classes of vector spaces:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Cn_vec_space_claim = CartExp(Complex, n).deduce_as_vec_space()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Rn_vec_space_claim = CartExp(Real, n).deduce_as_vec_space()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### We can find a specific “including” vector space for our Cartesian products as well, though in the case of Cartesian products we get a Cartesian product back again and not technically a vector space with an associated field attribute:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from proveit.linear_algebra.vector_spaces import including_vec_space\n",
"Cn_including_vec_space = including_vec_space(CartExp(Complex, n), field=Complex)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"Rn_including_vec_space = including_vec_space(CartExp(Real, n), field=Real)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Notice that the “including” vector space returned in the case of a Cartesian product is just the Cartesian product itself and not an explicit vector space with associated field attribute:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" some_field = Cn_including_vec_space.field\n",
"except Exception as the_exception:\n",
" print(f'{the_exception}')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### We can form the inner product of two vectors:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"InnerProd(v, w)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### And we can deduce the inner product's membership in a specified field:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"InnerProd(v, w).deduce_membership(Complex)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"InnerProd(x, y).deduce_membership(Real)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"InnerProd(v, x).deduce_membership(Complex)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### We see an (expected) error if we try to deduce that an inner product is Real when one vector is in $\\mathbb{R}^{n}$ while the other vector is in $\\mathbb{C}^{n}$:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" InnerProd(v, x).deduce_membership(Real)\n",
"except Exception as the_exception:\n",
" print(f'Exception: {the_exception}')"
]
},
{
"cell_type": "code",
Expand All @@ -37,7 +236,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
proveit.logic.equality.sub_right_side_into
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"outputs": [],
"source": [
"import proveit\n",
"from proveit import defaults\n",
"from proveit.linear_algebra.inner_products import hilbert_space_def\n",
"theory = proveit.Theory() # the theorem's theory"
]
},
Expand All @@ -27,6 +29,42 @@
"%proving hilbert_space_is_inner_prod_space"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"defaults.assumptions = hilbert_space_is_inner_prod_space.all_conditions()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"hilbert_space_def"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"hilbert_space_def.sub_right_side_into(hilbert_space_is_inner_prod_space.condition)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%qed"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -37,7 +75,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
proveit.linear_algebra.inner_products.hilbert_space_is_inner_prod_space
proveit.linear_algebra.inner_products.inner_prod_space_is_vec_space
Loading