Light and observation · one change at a time
A Middle Polarizer Reopens a Crossed Pair
Two polarizing sheets can make a light path look dark. Put a third sheet between them at a different angle, and a visible patch may return. The extra sheet has not supplied energy: it has changed the polarization direction of the light presented to the final sheet.
Polarization describes the direction in which light’s electric field oscillates across its direction of travel. A linear polarizer preferentially transmits one such direction, its transmission axis. An axis is a line rather than a one-way arrow. Degrees (°) measure angle, with360° in a full turn; a180° half-turn gives the same axis orientation. In this lesson, intensity means optical energy arriving per unit area per unit time. Brightness is how light appears to a person. Those are different quantities.
We will use three exact Thorlabs LPVISE2X2 sheets, ordinary low-power diffuse visible illumination and a separate paper viewing screen. Diffuse light spreads over directions rather than forming a narrow beam. The real activity is a qualitative comparison—describing visible differences—while complete Python code computes an explicitly ideal projection model: projection takes the component along a chosen axis. No circuit, photodiode (a light-sensitive semiconductor device), assembled prototype, calibrated light reading (checked against a reference) or physical result is claimed.
Check the actual film before building
The current Thorlabs item is a 2 inch × 2 inch (50.8 mm × 50.8 mm) dichroic film sheet for 400–700 nanometres (nm), where a nanometre is one billionth of a metre. A millimetre (mm) is one thousandth of a metre. Dichroic here means that the film transmits and absorbs the two polarization directions differently; it is not a pair of glass windows. Use three separately identifiable, undamaged sheets. Do not substitute circular-polarizing glasses or an unknown display film.
The manufacturer’s current family instructions matter to this experiment: the axis is marked by an arrow aligned with a flat edge; protective layers on both sides must be removed before use; mounting stress can change performance; and the transmitted light can scatter (spread into extra directions) or move sideways when a sheet rotates. This sideways motion is called beam walk. Thorlabs recommends this film for low-power use and fixed output directions, rather than preserving an image or continuously rotating an attenuator. An attenuator reduces light. We therefore set and secure each angle before making a comparison, keep the final output axis fixed, and check the illuminated patch again after every change.
Transfer the manufacturer’s axis reference to the loose frame before removing protective layers, following the supplied handling instructions. Keep fingers and adhesive out of the useful area. Support the edges gently: do not tension, crease or squeeze the sheet. Follow Thorlabs’ cleaning guidance rather than rubbing it or guessing a solvent. If the identity, axis mark or protective layers are uncertain, stop the physical activity and use the offline model.
The manufacturer lists real wavelength-dependent transmission and a finite extinction ratio, the ratio of maximum to minimum transmission for an appropriately polarized input. A real crossed pair, with its axes at right angles, therefore need not be black. Unpolarized input has no preferred transverse polarization direction; transverse means across the direction of travel. The ideal 50% first-sheet factor below is not an LPVISE2X2 transmission specification. The current table’s average unpolarized transmission is 38% across its stated range; that average is neither a constant at every wavelength nor an expected human-brightness ratio. We do not fit the actual film using that one number. Its rejected light is largely lost from the useful path; this is not an energy-producing device.
Lay out a path that really reaches the screen
A field is the area of light being observed. An aperture is a clear opening that limits that area. Here an optical path is the ordered route from source card through the sheets to the screen. The source card and viewing screen have different jobs: the first scatters lamp light into the path; the second catches the light after P3. The viewer watches that output screen from the side, outside the straight path, rather than looking through the sheets at the source card.
The original Scalable Vector Graphics (SVG) drawing is editable; the Portable Network Graphics (PNG) image is a full-size raster copy, a grid of image pixels. SVG and PNG are image formats. The drawing shows geometry and axis references, not a completed apparatus or an electrical schematic.

| Item | Quantity | Purpose and boundary |
|---|---|---|
| Thorlabs LPVISE2X2 | 3 | P1 defines the first axis; P2 changes the intermediate axis; P3 selects the fixed output direction. |
| Loose opaque card frames and stable stands | 3 | Hold uncut sheets flat without stress. Suggested frame size about100 mm square, with40 mm circular clear openings. |
| Ordinary enclosed low-power diffuse visible lamp | 1 | Illuminate a broad white source card from the same face that sends light toward P1. No laser, focused source, direct sun or hot lamp close to the film. |
| Matte white source card | 1 | Provide a broad nearly uniform input field. Its light is not certified unpolarized. |
| Translucent white tracing-paper screen in a fixed holder | 1 | Catch and scatter the transmitted patch after P3, so it can be viewed off axis. Its scattering/transmission is not calibrated. |
| Opaque cover card, ruler, protractor and pencil | 1 set | Block the complete observation field, mark positions, and set repeatable nominal angles. |
| CPython3.9 or later on a desktop computer | 1 | Run the complete offline ideal model and record checker. CPython is the standard desktop implementation of Python; no device firmware is needed. |
Suggested starting geometry is P1 to P3 about200 mm, with P2 near the middle and the screen about20 mm beyond P3. Place the white source card at least100 mm before P1, with the lamp above and to the side illuminating its forward-facing surface. These distances are build choices, not guaranteed light levels. Use a sufficiently broad uniform source-card patch and keep the sheets approximately parallel, facing the path. Normal incidence means light arriving perpendicular to a sheet. Our ideal model assumes that direction; a diffuse physical field contains a range of directions. The manufacturer’s acceptance angle does not make every oblique ray obey our exact two-dimensional model.
Mark a small central observation zone on the viewing-screen holder, without putting a dark mark in the patch itself. Lock the lamp, source card, P1, P3, screen and viewing position once the crossed baseline has been established. Ambient room light must be low enough that a difference can actually be seen. Shade the viewing screen from direct lamp and room light using opaque card around the optical path, without touching or stressing the film. Do not interpret an uncovered bright edge, a shadow or a shifted spot as restored transmission.
For angles, look from the screen side back toward the source card. Define P1’s axis as0°. Parallel axes point along the same line; crossed axes are at90° to one another. Set the middle axis clockwise from P1 in that view. Clockwise versus counterclockwise does not change the ideal squared-projection result, but one consistent convention makes the notes repeatable. Use the axis marks for starting positions and find the outer pair’s darkest settled setting operationally. That is a reproducible local minimum, not proof of an exact90° angle or specified extinction.
Calculate the ideal result before observing
Malus’s law describes an ideal linear polarizer receiving already linearly polarized light: the transmitted intensity is multiplied by cos² of the angle difference. The cosine is a trigonometric projection factor; squaring converts field amplitude—the size of its oscillation—to intensity. The emerging light is aligned with the new axis. Applying a single filter cannot increase the intensity along that one path.
For an ideal unpolarized input, meaning a collection of waves with no preferred transverse polarization direction, the first ideal polarizer gives I1=I0/2. I0 denotes intensity before P1 and I1 just after it. That one-half is applied once, not once per sheet. If the source is already polarized, the first result depends on its axis instead. Reflected lamp light and display screens must not be presumed unpolarized; that is why this physical activity does not infer an absolute incident-light fraction.
Let θ (theta) name the middle-axis angle relative to P1; Δθ means the difference between neighboring axes. With P3 at90°, the last cosine projection is cos(90°−θ)=sinθ, where sin denotes the sine trigonometric function.
Ideal linearly polarized input: I_out = I_in cos²(Δθ)
Unpolarized input through ideal P1: I1 = I0/2
P1=0°, P2=θ, P3=90°:
I3/I1 = cos²θ sin²θ = (1/4) sin²(2θ)
I3/I0 = (1/8) sin²(2θ), only when I1=I0/2
With P1 at0° and P3 at90°, P2 at45° passes half the ideal I1; P3 then passes half of that. The result is I1/4. Only for the separate unpolarized-input assumption is this I0/8. At30°, the factors are cos²30°=3/4 and sin²30°=1/4, giving3I1/16 or3I0/32 under that assumption. The two denominators must not be mixed.
The identity cos²θ sin²θ=sin²(2θ)/4 shows maxima at45° and135°, and zeros at0°,90° and180°. The code converts degrees to radians, another angle unit with2π radians in a full turn; π is the circle constant, approximately3.14159. An axis repeats every180°, so135° and−45° describe the same middle line.
The comma-separated values (CSV) file is a plain table with commas separating fields. The constructed ideal CSV and both panels below are generated by the delivered program’s actual projection function, in5° steps. They are not fitted film data, photographs or measured brightness. Normalization divides each intensity by a chosen reference: the right panel divides by I1 just after ideal P1; the left uses I0 and additionally assumes an unpolarized incident ensemble.

Order matters. The chain0°→45°→90° has an intermediate projection before the final crossed sheet. The chain0°→90°→45° has already lost all light in the ideal crossed pair before the third sheet can act. Adding a sheet after that pair cannot recover it. With a real imperfect pair there can be residual light, but that is not the ideal restoration mechanism.
Use controls, not a continuous rotation display
Make every angle change as a separate static trial. Turn the lamp off or cover the path, adjust the middle frame, secure it, then restore the same source condition and wait until the field is steady before observing. Do not watch a sweep and call the changing spot a transmission curve. Thorlabs specifically warns about beam movement during rotation; the final output direction here remains fixed by P3.
- Inspect and align. Identify the three sheets and their axes, remove both protective layers as instructed, and assemble the loose frames. Confirm the actual path reaches the separate viewing screen. Keep the viewer outside the direct path, watching only the diffuse screen patch. This is not an image-resolution experiment.
- Covered control. With P2 absent and the outer axes parallel, place the opaque card over the complete P3 exit opening, between P3 and the viewing screen, without touching either film or screen. Record whether the selected screen field becomes dark or remains contaminated by stray light. Uncover it without moving the screen. This is a qualitative background/bypass check, not a numerical dark subtraction.
- Parallel reference. With P2 absent and P1/P3 nominally parallel, establish a clearly visible uniform screen patch if the available lamp and room permit it. Record the source identity, positions and nominal axes. If even this reference is not resolved, retain the model but stop the comparison rather than increasing to an unqualified intense source.
- Crossed baseline. Set P3 near90° and find the darkest settled outer-pair setting. Keep P1 and that P3 axis fixed for all remaining rows. Check that the same screen zone is still filled and not simply in a shifted shadow. Residual light is allowed; no measured extinction is claimed.
- Insert P2 at0°. Put the middle sheet between P1/P3 with its axis parallel to P1, without touching either outer sheet. After settling, check the useful field. Ideal geometry predicts no reopened path in this setting.
- Set P2 near45°. Make a separate fixed-angle trial. Check the screen zone and note whether a patch is now clearly distinguishable from the crossed baseline. The ideal mechanism predicts a nonzero path, but this is not an observed numerical quarter or eighth.
- Check90° and135°. Use separate settled trials at each nominal middle angle. The ideal90° chain stays crossed;135° gives the same ideal intensity as45°. Actual apparent equality is not a calibrated angular or transmission test.
- Remove and restore. Remove only P2, keeping the lamp, outer axes and screen fixed. Does the crossed baseline return? Reinsert the same P2 at its recorded45° setting, check alignment and compare again. Failure to restore is a reason to investigate motion, stress, light changes and visual uncertainty before attributing an effect to polarization.
Alignment is a gate for every static row. The broad patch must still fill the same central screen zone without a clipped edge. If the middle sheet moves the field, adjust only its lateral position while preserving its chosen angle; recheck coverage. Do not move the screen, source or outer axes opportunistically to obtain the expected brightness. If coverage cannot be restored under those constraints, mark the comparison uncertain and do not treat it as a polarization result. Record the adjustment in the notes.
| Case | P2 / P3 nominal axes | What it controls |
|---|---|---|
| covered | Absent / parallel | Opaque cover fully blocks the observation field; checks bypass/ambient limitation. |
| parallel | Absent /0° | A resolvable bright reference, not an absolute transmission reading. |
| crossed | Absent / operational90° minimum | Reference for the remaining fixed-output-axis trials. |
| middle_0 | 0° / fixed90° | Insertion without a new intermediate axis. |
| middle_45 | 45° / fixed90° | Candidate reopened path. |
| middle_90 | 90° / fixed90° | Second intermediate-axis endpoint. |
| middle_135 | 135° / fixed90° | Ideal axis symmetry, with real angle/appearance limitations. |
| removed | Absent / fixed90° | Return to the crossed arrangement. |
| restored_45 | Same P2 at45° / fixed90° | Repeat the same arrangement, not a different sheet or brighter source. |
Keep subjective observations out of the intensity model
The blank observation worksheet contains no readings. Fill the nine rows with the same source identifier, condition flags and one appearance category: clearly_visible, faint, dark or uncertain. These are coarse descriptions rather than calibrated numbers. Record the actual nominal angles, frame positions, covered-control limitations, any middle-frame recentering and viewing conditions in notes. A photograph with automatic exposure does not supply a brightness ratio; neither does the eye’s adaptation to darkness.
The record command reads this worksheet strictly. Use kind=measured for a real trial’s manually observed record or constructed for invented practice data. Here that field is a provenance label—where a record came from—not evidence of calibrated intensity measurement. Conditions may be yes, no or unknown. The output reports whether the entries declare one consistent source and all conditions yes, but always retains physical_validated=false, photometry_validated=false and zero numerical comparisons. Photometry is quantitative measurement of light with a defined response; none is supplied here.
The reader ZIP is a compressed archive of the complete literal sources and worksheets. Extract it before running the code; keep the Python and test files together. The commands below use only Python’s standard library. Model output is JavaScript Object Notation (JSON), a structured text format. A missing/extra/duplicate/reordered case, malformed header or quoted CSV, mixed provenance, invalid flag/category, blank source identity, multiline note or excessive file is refused with exit2 and no JSON. A complete record exits0 even when conditions are unknown or inconsistent; exit0 is not a physical pass.
python3 -m unittest -v
python3 polarizers.py model --middle 45
python3 polarizers.py curve > my-ideal-curve.csv
python3 polarizers.py record observations-blank.csv
The untouched blank worksheet is expected to be refused until real entries are supplied. The model command assumes ideal unit incident intensity and unpolarized input; its fractions are constructed. The Python transmit function also accepts a declared linearly polarized input axis and a finite nonnegative incident intensity. It permits at most64 axes, each within±3600°, and intensity up to1012 arbitrary model units. These are numerical input limits, not lamp ratings. Axes are reduced modulo180°. Tiny floating-point residues near a mathematical zero are not light leakage.
Complete offline program: polarizers.py
"""Ideal ordered linear polarizers and a qualitative record reader; no photometry."""
import argparse
import csv
import io
import json
import math
import sys
LIMIT = 65536
FIELDS = ['case','kind','source_id','source_stable','field_fixed','room_fixed',
'axes_checked','appearance','notes']
CASES = ['covered','parallel','crossed','middle_0','middle_45','middle_90',
'middle_135','removed','restored_45']
CONDITIONS = ['source_stable','field_fixed','room_fixed','axes_checked']
def angle(value):
if isinstance(value, bool) or not isinstance(value, (int,float)):
raise ValueError('angle must be a real number in degrees')
if abs(value) > 3600 or not math.isfinite(value):
raise ValueError('angle must be finite and within -3600 to 3600 degrees')
return value % 180
def transmit(angles, intensity=1.0, input_axis=None):
"""Ideal intensity; None input_axis means an unpolarized ensemble."""
if not isinstance(angles, (list,tuple)) or len(angles) > 64:
raise ValueError('supply a list/tuple of at most 64 axes')
if isinstance(intensity,bool) or not isinstance(intensity,(int,float)):
raise ValueError('intensity must be a real number')
if not 0 <= intensity <= 1e12 or not math.isfinite(intensity):
raise ValueError('intensity must be finite, nonnegative and at most 1e12')
axes = [angle(x) for x in angles]
previous = None if input_axis is None else angle(input_axis)
result = float(intensity)
for current in axes:
if previous is None:
result *= 0.5
else:
result *= math.cos(math.radians(current-previous)) ** 2
previous = current
return result
def cases(middle):
middle = angle(middle)
value = transmit([0,middle,90])
return dict(source_kind='constructed_ideal_model',middle_deg=middle,
parallel=transmit([0,0]), crossed=transmit([0,90]),
with_middle=value, relative_to_after_first=value/0.5,
middle_after_crossed=transmit([0,90,middle]),
removed=transmit([0,90]), restored=value,
incident_normalization=1.0, after_first_normalization=0.5,
physical_validated=False, photometry_validated=False)
def curve():
return [(a,transmit([0,a,90]),transmit([0,a,90])/0.5)
for a in range(0,181,5)]
def record(text):
"""Read declared qualitative observations, never compare them to intensities."""
if len(text.encode('utf-8')) > LIMIT:
raise ValueError('record exceeds 65536 bytes')
try:
reader = csv.DictReader(io.StringIO(text,newline=''),strict=True)
if reader.fieldnames != FIELDS:
raise ValueError('header must be exactly '+','.join(FIELDS))
rows = list(reader)
except csv.Error as exc:
raise ValueError('invalid CSV: '+str(exc)) from None
if len(rows) != len(CASES):
raise ValueError('need exactly the nine named control rows')
kind = None
for case,row in zip(CASES,rows):
if set(row) != set(FIELDS) or any(x is None for x in row.values()):
raise ValueError('missing or extra columns')
if row['case'] != case:
raise ValueError('cases must appear once in the documented order')
if row['kind'] not in ('constructed','measured'):
raise ValueError('kind must be constructed or measured')
if kind is None:
kind = row['kind']
if kind != row['kind']:
raise ValueError('do not mix constructed and measured rows')
if not row['source_id'].strip() or len(row['source_id']) > 80:
raise ValueError('source_id must identify the source in 1 to 80 characters')
if any(row[k] not in ('yes','no','unknown') for k in CONDITIONS):
raise ValueError('condition flags must be yes, no or unknown')
if row['appearance'] not in ('clearly_visible','faint','dark','uncertain'):
raise ValueError('appearance must be clearly_visible, faint, dark or uncertain')
if len(row['notes']) > 300 or any(ord(c)<32 for c in row['notes']+row['source_id']):
raise ValueError('notes/source_id must be single-line text; notes at most 300 characters')
consistent = (len({r['source_id'] for r in rows}) == 1 and
all(r[k]=='yes' for r in rows for k in CONDITIONS))
return dict(kind=kind,rows=rows,record_complete=True,
conditions_declared_consistent=consistent,
physical_validated=False, photometry_validated=False,
numeric_comparisons=0,
scope='Subjective record only. No brightness ratio, extinction, Malus-law fit, source stability or alignment is validated.')
def main():
parser = argparse.ArgumentParser(description=__doc__)
sub = parser.add_subparsers(dest='command',required=True)
model = sub.add_parser('model',help='constructed ideal comparison cases')
model.add_argument('--middle',type=float,default=45)
sub.add_parser('curve',help='constructed 0 to 180 degree curve, 5 degree steps')
rec = sub.add_parser('record',help='read the qualitative worksheet only')
rec.add_argument('file',help='UTF-8 CSV path, or - for standard input')
args = parser.parse_args()
try:
if args.command == 'model':
result = cases(args.middle)
elif args.command == 'curve':
out = io.StringIO(newline='')
writer = csv.writer(out,lineterminator='\n')
writer.writerow(['middle_deg','relative_to_incident','relative_to_after_first'])
writer.writerows((a,format(b,'.15g'),format(c,'.15g')) for a,b,c in curve())
print(out.getvalue(),end='')
return 0
else:
if args.file == '-':
text = sys.stdin.read(LIMIT+1)
else:
with open(args.file,encoding='utf-8',newline='') as handle:
text = handle.read(LIMIT+1)
result = record(text)
except (ValueError,UnicodeError,OSError) as exc:
print('Refused: '+str(exc),file=sys.stderr)
return 2
print(json.dumps(result,indent=2))
return 0
if __name__ == '__main__':
raise SystemExit(main())
Complete behavior tests: test_polarizers.py
import csv
import io
import json
import math
from pathlib import Path
import random
import subprocess
import sys
import unittest
import polarizers as p
HERE = Path(__file__).resolve().parent
FIELDS = ['case','kind','source_id','source_stable','field_fixed','room_fixed',
'axes_checked','appearance','notes']
CASES = ['covered','parallel','crossed','middle_0','middle_45','middle_90',
'middle_135','removed','restored_45']
def worksheet(kind='constructed'):
s = io.StringIO(newline='')
w = csv.writer(s, lineterminator='\n')
w.writerow(FIELDS)
for case in CASES:
w.writerow([case,kind,'invented-source','yes','yes','yes','yes','uncertain','not a bench result'])
return s.getvalue()
def vector_oracle(angles, input_axis=None):
def project(axis):
v = [math.cos(math.radians(axis)), math.sin(math.radians(axis))]
for angle in angles:
u = [math.cos(math.radians(angle)), math.sin(math.radians(angle))]
dot = sum(x*y for x,y in zip(v,u))
v = [dot*x for x in u]
return sum(x*x for x in v)
return (project(0)+project(90))/2 if input_axis is None else project(input_axis)
class GeometryTests(unittest.TestCase):
def test_no_sheet_does_not_halve_light(self):
self.assertEqual(p.transmit([], intensity=7), 7)
def test_first_unpolarized_sheet_halves_only_once(self):
self.assertAlmostEqual(p.transmit([20]), .5)
self.assertAlmostEqual(p.transmit([20,20,20]), .5)
def test_first_aligned_linear_sheet_is_not_half(self):
self.assertAlmostEqual(p.transmit([20], input_axis=20), 1)
def test_crossed_outer_pair(self):
self.assertAlmostEqual(p.transmit([0,90]), 0)
def test_middle45_reopens_one_eighth_incident(self):
self.assertAlmostEqual(p.transmit([0,45,90]), .125)
self.assertAlmostEqual(p.cases(45)['relative_to_after_first'], .25)
def test_middle30_worked_example(self):
self.assertAlmostEqual(p.transmit([0,30,90]), .09375)
def test_middle_endpoints_stay_crossed(self):
for angle in [0,90,180]:
with self.subTest(angle=angle):
self.assertAlmostEqual(p.transmit([0,angle,90]), 0)
def test_axis_periodicity_and_second_maximum(self):
self.assertAlmostEqual(p.transmit([0,135,90]), .125)
self.assertAlmostEqual(p.transmit([180,225,-90]), .125)
def test_middle_must_be_between_outer_sheets(self):
self.assertAlmostEqual(p.transmit([0,90,45]), 0)
self.assertGreater(p.transmit([0,45,90]), .12)
def test_rotating_every_axis_together_preserves_result(self):
self.assertAlmostEqual(p.transmit([0,31,90]), p.transmit([123,154,213]))
def test_input_intensity_scaling_and_zero(self):
self.assertAlmostEqual(p.transmit([0,45,90], intensity=8), 1)
self.assertEqual(p.transmit([0,45,90], intensity=0), 0)
def test_projection_vector_oracle_and_chain_energy(self):
rng = random.Random(236)
for _ in range(200):
angles = [rng.uniform(-360,360) for _ in range(rng.randrange(1,7))]
self.assertAlmostEqual(p.transmit(angles), vector_oracle(angles), places=12)
axis = rng.uniform(-180,180)
self.assertAlmostEqual(p.transmit(angles,input_axis=axis), vector_oracle(angles,axis), places=12)
vals = [p.transmit(angles[:n]) for n in range(len(angles)+1)]
self.assertTrue(all(0 <= b <= a + 1e-14 for a,b in zip(vals,vals[1:])))
def test_nonfinite_or_excessive_angles_refused(self):
for a in [math.nan, math.inf, -math.inf, 3601, -3601, True, '45']:
with self.subTest(a=a), self.assertRaises(ValueError):
p.transmit([0,a,90])
def test_invalid_intensity_or_input_axis_refused(self):
for x in [-1,math.nan,math.inf,1e13,True]:
with self.subTest(x=x), self.assertRaises(ValueError):
p.transmit([0],intensity=x)
with self.assertRaises(ValueError):
p.transmit([0],input_axis=math.nan)
def test_oversized_integer_is_a_controlled_refusal(self):
for call in [lambda: p.transmit([10**400]),lambda: p.transmit([0],intensity=10**400)]:
with self.assertRaises(ValueError):
call()
def test_string_or_excessive_chain_refused(self):
for chain in ['04590',[0]*65,None]:
with self.subTest(chain=chain), self.assertRaises(ValueError):
p.transmit(chain)
def test_curve_samples_match_identity_independent(self):
rows = p.curve()
self.assertEqual(len(rows),37)
for angle, incident, first in rows:
expected = math.sin(math.radians(2*angle))**2/8
self.assertAlmostEqual(incident,expected)
self.assertAlmostEqual(first,2*expected)
class RecordTests(unittest.TestCase):
def test_constructed_record_never_becomes_photometry(self):
r = p.record(worksheet())
self.assertEqual(r['kind'],'constructed')
self.assertEqual(r['physical_validated'],False)
self.assertEqual(r['photometry_validated'],False)
self.assertEqual(r['numeric_comparisons'],0)
def test_measured_record_is_still_subjective(self):
r = p.record(worksheet('measured'))
self.assertTrue(r['conditions_declared_consistent'])
self.assertFalse(r['physical_validated'])
self.assertFalse(r['photometry_validated'])
def test_unknown_or_failed_conditions_are_not_fixed(self):
for value in ['unknown','no']:
r=p.record(worksheet().replace(',yes,',','+value+',',1))
self.assertFalse(r['conditions_declared_consistent'])
def test_mixed_source_identity_not_consistent(self):
r=p.record(worksheet().replace('invented-source','different',1))
self.assertFalse(r['conditions_declared_consistent'])
def test_duplicate_missing_or_reordered_cases_refused(self):
lines=worksheet().splitlines(True)
for altered in [lines[:-1],lines+[lines[-1]],lines[:1]+[lines[2],lines[1]]+lines[3:]]:
with self.subTest(altered=altered), self.assertRaises(ValueError):
p.record(''.join(altered))
def test_mixed_or_unknown_provenance_refused(self):
for text in [worksheet().replace('constructed','measured',1),worksheet().replace('constructed','measuredish')]:
with self.assertRaises(ValueError):p.record(text)
def test_bad_headers_and_malformed_csv_refused(self):
for text in [worksheet().replace('case,kind','case,case',1),'"case,kind\n',worksheet()+'"oops']:
with self.subTest(text=text), self.assertRaises(ValueError):p.record(text)
def test_blank_unknown_fields_and_extra_columns_refused(self):
for text in [worksheet().replace('invented-source','',1),worksheet().replace('yes','perhaps',1),worksheet().replace('uncertain','1.23',1),worksheet().replace('not a bench result\n','note,extra\n',1)]:
with self.assertRaises(ValueError):p.record(text)
def test_size_and_multiline_note_refused(self):
with self.assertRaises(ValueError):p.record('x'*65537)
with self.assertRaises(ValueError):p.record(worksheet().replace('not a bench result','"two\nlines"',1))
def test_cli_model_and_curve_are_constructed(self):
a=subprocess.run([sys.executable,str(HERE/'polarizers.py'),'model','--middle','45'],capture_output=True,text=True)
self.assertEqual(a.returncode,0)
self.assertEqual(json.loads(a.stdout)['source_kind'],'constructed_ideal_model')
b=subprocess.run([sys.executable,str(HERE/'polarizers.py'),'curve'],capture_output=True,text=True)
self.assertEqual(b.returncode,0)
self.assertEqual(len(list(csv.reader(io.StringIO(b.stdout)))),38)
def test_cli_bad_angle_and_quoted_header_no_json(self):
for args,data in [(['model','--middle','nan'],None),(['record','-'],'"case,kind\n')]:
r=subprocess.run([sys.executable,str(HERE/'polarizers.py')]+args,input=data,capture_output=True,text=True)
self.assertEqual((r.returncode,r.stdout,'Traceback' in r.stderr),(2,'',False))
self.assertIn('Refused:',r.stderr)
def test_cli_measured_provenance_is_preserved(self):
r=subprocess.run([sys.executable,str(HERE/'polarizers.py'),'record','-'],input=worksheet('measured'),capture_output=True,text=True)
self.assertEqual(r.returncode,0)
self.assertEqual(json.loads(r.stdout)['kind'],'measured')
self.assertFalse(json.loads(r.stdout)['photometry_validated'])
if __name__ == '__main__':
unittest.main()
The29 host test methods cover absolute versus after-first normalization, already-polarized input, order, common-axis rotation,180° periodicity, chain energy and strict records/command-line errors. They independently compare200 varied ordered chains against a two-component vector-projection oracle for both polarized and unpolarized cases. Initial unimplemented behavior failed before implementation; an oversized-integer regression then exposed and corrected an uncontrolled numeric-conversion error. These are executed desktop software checks, not optical measurements. The figure-generation helper uses the same delivered projection function as the curve command.
Diagnose a weak or misleading comparison
- No usable reference: ambient light may dominate, the path may miss the screen, a protective layer may remain, or the source may simply be too dim. Keep the trial unresolved. Do not infer a failed polarization law.
- Crossed and parallel look alike: check part identity, axis references, stray paths and viewing-screen illumination from outside the sheets. Avoid a pre-polarized display as a casual replacement source.
- A bright edge moves as P2 changes: suspect beam walk or clipping. Stop, settle and recheck the same central zone; brightness at a different screen position is not the intended comparison.
- Restoration changes: check source drift, room light, loose stands, film stress, changed angle and observer adaptation. Several causes can coexist. The worksheet does not correct them.
- Crossed never looks fully black: real finite extinction, scatter and ambient light are expected possibilities. This recipe cannot separate or quantify those contributions.
Challenge. In the ideal model with unpolarized incident light, compare0°→30°→90° with0°→90°→30°. Give the output fractions relative to I0 and I1. Why would a real screen appearing twice as bright not prove either ideal fraction?
Answer and rationale
The first order gives(1/2)×(3/4)×(1/4)=3/32 of I0, equivalently3/16 of I1. The second order has an ideal crossed pair before the final sheet, so its output is zero relative to either nonzero reference. Each chain separately loses or retains energy; comparing two different chains is not adding energy to one chain. Apparent screen brightness includes spectral weighting, screen scattering, ambient light, adaptation, field position and nonideal film transmission. It is not a calibrated intensity ratio, and the incident field was not proved unpolarized.
Files, related outcomes and primary reading
Extract the complete reader ZIP for all code, tests, both original SVG/PNG pairs, the ideal CSV and blank worksheet. The included HTML (Hypertext Markup Language) structures the article; CSS (Cascading Style Sheets) provides its local presentation. The archive intentionally excludes itself. After extraction use the included files; the ZIP download link belongs to the containing delivery directory.
For a different optical boundary, read the existing BPW34 sampling-alias experiment. For an actual electrical background-subtraction method, see Subtract the Room Light From a Pulsed LED Reading. Their detector circuits, sampling assumptions and numerical results are not part of this passive visual recipe.
- Thorlabs exact LPVISE2X2 item and current economy-film family instructions and specifications. Access checked29November2026; no formal revision code displayed. Use the exact visible sheet, not the separately named near-infrared sheets. Current-axis/handling and fixed-output restrictions take priority over generic polarizer demonstrations.
- OpenStax University Physics Volume3,§1.7 Polarization, for ideal field projection, the unpolarized first-sheet factor and Malus’s law. All lesson drawings and calculated data here are original; no manufacturer or textbook figure is redistributed.
Verification boundary: complete local author preparation with constructed examples and executed host behavior tests. No assembled apparatus, sensor qualification, optical power/brightness measurement, native WordPress/Facebook action or publication is claimed. Independent technical/image review and actual desktop/mobile preview checks remain separate; a future live canonical must be verified before any announcement.